From 5f69dc1c8a8e7d7182268a27785f2b5f5d3c1f70 Mon Sep 17 00:00:00 2001 From: chrisdugne Date: Sun, 21 Feb 2021 23:01:32 +0100 Subject: [PATCH] updated delayedDispatch --- src/create-stores.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/create-stores.js b/src/create-stores.js index d67f76a..f2e1b1f 100644 --- a/src/create-stores.js +++ b/src/create-stores.js @@ -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); };