Skip to content

Commit

Permalink
fix: Update middlewares only if available (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciganandrea authored Feb 17, 2021
1 parent 00752af commit df1f780
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/stateMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -61,7 +61,10 @@ function actionTemplate<TCallback extends AnyCallback>(
};
}

export function useStateMachine<TCallback extends AnyCallback, TActions extends AnyActions<TCallback>>(
export function useStateMachine<
TCallback extends AnyCallback,
TActions extends AnyActions<TCallback>
>(
actions?: TActions,
): {
actions: ActionsOutput<TCallback, TActions>;
Expand Down

0 comments on commit df1f780

Please sign in to comment.