aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reactHelper.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-20 17:56:56 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-20 17:56:56 -0700
commitb2cd88bbbad82654057cec8aec7415a8caca667e (patch)
treec9d8485cdd5f2e4fd7558b963d095027c3913e86 /modern/src/reactHelper.js
parentfc990dcc50650862c4f12a1a530b98bbd36ea4b8 (diff)
downloadtrackermap-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.js6
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);
+}