- createStore(
initialState: Partial<State>,
): {
clearOnChange: <T>(callback: (piece: T) => void) => void;
getInitialState: () => Partial<State>;
getState: () => State;
onChange: <T>(
selector: (state: State) => T,
callback: (piece: T) => void,
) => void;
updateState: (newState: Partial<State>) => void;
} Parameters
- initialState: Partial<State>
Returns {
clearOnChange: <T>(callback: (piece: T) => void) => void;
getInitialState: () => Partial<State>;
getState: () => State;
onChange: <T>(
selector: (state: State) => T,
callback: (piece: T) => void,
) => void;
updateState: (newState: Partial<State>) => void;
}