Write more documentation

This commit is contained in:
mrjvs
2023-12-29 16:59:30 +01:00
parent 8904e87b7e
commit 8ac11d9067
11 changed files with 199 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
# `makeProviders`
Make an instance of providers with configuration.
Make an instance of provider controls with configuration.
This is the main entrypoint of the library. It is recommended to make one instance globally and reuse it throughout your application.
## Example

View File

@@ -1,6 +1,6 @@
# `makeStandardFetcher`
Make a fetcher from a `fetch()` API. It is used for making a instance of providers with `makeProviders()`.
Make a fetcher from a `fetch()` API. It is used for making a instance of provider controls.
## Example
@@ -8,13 +8,13 @@ Make a fetcher from a `fetch()` API. It is used for making a instance of provide
import { targets, makeProviders, makeDefaultFetcher } from "@movie-web/providers";
const providers = makeProviders({
fetcher: makeDefaultFetcher(fetch),
target: targets.NATIVE,
fetcher: makeStandardFetcher(fetch),
target: targets.ANY,
});
```
## Type
```ts
function makeDefaultFetcher(fetchApi: typeof fetch): Fetcher;
function makeStandardFetcher(fetchApi: typeof fetch): Fetcher;
```