- createMutation<T, R>(fn: ((args: T) => Promise<R>), options?: CreateMutationOptions<R>): { error: Accessor<unknown>; isError: (() => boolean); isLoading: Accessor<boolean>; isSuccess: Accessor<boolean>; mutateAsync: ((args: T) => Promise<R>); reset: (() => void); returnedData: Accessor<undefined | R> }
-
Parameters
-
fn: ((args: T) => Promise<R>)
-
- (args: T): Promise<R>
-
Returns Promise<R>
-
Returns { error: Accessor<unknown>; isError: (() => boolean); isLoading: Accessor<boolean>; isSuccess: Accessor<boolean>; mutateAsync: ((args: T) => Promise<R>); reset: (() => void); returnedData: Accessor<undefined | R> }
-
error: Accessor<unknown>
-
isError: (() => boolean)
-
- (): boolean
-
Returns boolean
-
isLoading: Accessor<boolean>
-
isSuccess: Accessor<boolean>
-
mutateAsync: ((args: T) => Promise<R>)
-
- (args: T): Promise<R>
-
Returns Promise<R>
-
reset: (() => void)
-
returnedData: Accessor<undefined | R>
Create mutation
Description
https://yonathan06.github.io/solid-cached-resource/modules.html#createMutation