Creates a Query Store.

Remarks

This is a factory method for Query Stores used to provide context for Queries used to fetch data.

Example

Create a Query Store:

import {createQueryStore} from "@use-pico/client";

export const MyQueryStore = createQueryStore({});

Example

Provide Query Store to the component:

import {MyQueryStore} from "./MyQueryStore";

export const MyComponent = () => {
return <MyQueryStore.Provider
values={{
// Optional default values
filter: {name: "John"},
}}
>
<AnotherComponent/>
<MyQueryStore.Provider/>
}

Index

Interfaces