action()
Returns an Action for a given function.
function action<T = void>(fn: ActionFunction<T>): Action<T>
type ActionFunction<T> = (
props: {
call: StateXActionCaller,
get: StateXGetter,
getRef: StateXRefGetter,
remove: StateXRemover,
set: StateXSetter,
},
value: T,
) => void;
callCan be used to invoke other actions.geta function used to retrieve values from other paths/atoms/selectors. This function will not subscribe the selector to the given atoms/selectors.getRefa function used to retrieve a ref value at a given path.removeCan be used to remove value at other paths or atoms.setCan be used to set value of other paths/atoms/selectors.value- An optional value that is passed when invoking this action via. useStateXAction() hook.