diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-20 17:56:56 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-20 17:56:56 -0700 |
commit | b2cd88bbbad82654057cec8aec7415a8caca667e (patch) | |
tree | c9d8485cdd5f2e4fd7558b963d095027c3913e86 /modern/src/reactHelper.js | |
parent | fc990dcc50650862c4f12a1a530b98bbd36ea4b8 (diff) | |
download | trackermap-web-b2cd88bbbad82654057cec8aec7415a8caca667e.tar.gz trackermap-web-b2cd88bbbad82654057cec8aec7415a8caca667e.tar.bz2 trackermap-web-b2cd88bbbad82654057cec8aec7415a8caca667e.zip |
Use async functions
Diffstat (limited to 'modern/src/reactHelper.js')
-rw-r--r-- | modern/src/reactHelper.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modern/src/reactHelper.js b/modern/src/reactHelper.js index e8a4135a..9286c577 100644 --- a/modern/src/reactHelper.js +++ b/modern/src/reactHelper.js @@ -8,3 +8,9 @@ export const usePrevious = value => { }); return ref.current; } + +export const useEffectAsync = (effect, deps) => { + useEffect(() => { + effect(); + }, deps); +} |