Creates a Query Store.
This is a factory method for Query Stores used to provide context for Queries used to fetch data.
Create a Query Store:
import {createQueryStore} from "@use-pico/client";export const MyQueryStore = createQueryStore({}); Copy
import {createQueryStore} from "@use-pico/client";export const MyQueryStore = createQueryStore({});
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/>} Copy
import {MyQueryStore} from "./MyQueryStore";export const MyComponent = () => { return <MyQueryStore.Provider values={{ // Optional default values filter: {name: "John"}, }} > <AnotherComponent/> <MyQueryStore.Provider/>}
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:
Example
Provide Query Store to the component: