Skip to content

Commit

Permalink
updated delayedDispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdugne committed Feb 21, 2021
1 parent 2073356 commit 5f69dc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/create-stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ const createHooks = stores =>
const createDispatch = stores => {
let dispatch;

const delayedDispatch = (...params) => {
// to avoid recursive loops when perform uses dispatch
const delayedDispatch = action => {
setTimeout(() => {
dispatch(params);
dispatch(action);
}, 20);
};

Expand Down

0 comments on commit 5f69dc1

Please sign in to comment.