diff --git a/src/stateMachine.tsx b/src/stateMachine.tsx index 1ccfe7c..d821ad8 100644 --- a/src/stateMachine.tsx +++ b/src/stateMachine.tsx @@ -20,7 +20,7 @@ export function createStore( ) { options.name && (storeFactory.name = options.name); options.storageType && (storeFactory.storageType = options.storageType); - storeFactory.updateMiddleWares(options.middleWares); + options.middleWares && storeFactory.updateMiddleWares(options.middleWares); if (process.env.NODE_ENV !== 'production') { setUpDevTools( @@ -61,7 +61,10 @@ function actionTemplate( }; } -export function useStateMachine>( +export function useStateMachine< + TCallback extends AnyCallback, + TActions extends AnyActions +>( actions?: TActions, ): { actions: ActionsOutput;