@just-web/fetch
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@just-web/fetch

NPM version NPM downloads

@just-web/fetch provides fetch API for a @just-web applications.

Install

# npm
npm install @just-web/fetch

# yarn
yarn add @just-web/fetch

# pnpm
pnpm install @just-web/fetch

#rush
rush add -p @just-web/fetch

Usage

import { justApp } from '@just-web/app'
import { fetchGizmo } from '@just-web/fetch'

const app = await justApp({ name: 'your-awesome-app' })
  .with(fetchGizmo)
  .create()

app.fetch(...)

Testing

@just-web/fetch provides a fetchTestGizmoFn() under @jest-web/fetch/testing.

It can be used during tests to stub the fetch behavior.

import { justTestApp } from '@just-web/app/testing'
import { fetchTestGizmoFn } from '@just-web/fetch/testing'

const app = await justTestApp().with(fetchTestGizmoFn({
  fetch(...args) { /* ..snap.. */ }
}))

Readme

Keywords

Package Sidebar

Install

npm i @just-web/fetch

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

18.3 kB

Total Files

52

Last publish

Collaborators

  • unional