Variable: postFetchState
Imported from
@react-logic/utils
constpostFetchState:FetchStateMethodPreset
Defined in: utils/src/lib/fetch-state.ts:643
POST-flavoured fetchState. Reactive by default (tracks the build
callback's signal reads); .callable is the imperative companion.
// Reactive — e.g. a GraphQL query that re-fires when its input changes.
const profile = postFetchState((id = '') => ({
url: '/graphql',
body: { query: USER_QUERY, variables: { id } },
}));
// Imperative — typical mutation.
const submit = postFetchState.callable((message: string) => ({
url: '/api/comments',
body: { message },
}));
submit.fetch('hello world');