We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have issues with actions which have no payloads (eg. init or reset functions)
import { useStateMachine } from "little-state-machine"; export type GlobalState = { stateValue: string; }; const defaultState: GlobalState = { stateValue: "value" }; export default function Example() { const { actions } = useStateMachine({ reset: () => {...defaultState} // <--- Action without payload }); actions.reset() // <--- Type Error: expects a payload argument return null }
Reason:
export declare type ActionsOutput<TCallback extends AnyCallback, TActions extends AnyActions<TCallback>> = { [K in keyof TActions]: (payload: Parameters<TActions[K]>[1]) => void; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have issues with actions which have no payloads (eg. init or reset functions)
Reason:
The text was updated successfully, but these errors were encountered: