From 0e4a9c3bea38fd2ed2bede2605de68a22e06e74f Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 13 Jul 2021 00:27:38 -0400 Subject: [PATCH] Add UseMountEffect --- src/hooks/UseMountEffect.tsx | 3 +++ src/hooks/index.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/hooks/UseMountEffect.tsx create mode 100644 src/hooks/index.ts diff --git a/src/hooks/UseMountEffect.tsx b/src/hooks/UseMountEffect.tsx new file mode 100644 index 00000000..cb6f7bf6 --- /dev/null +++ b/src/hooks/UseMountEffect.tsx @@ -0,0 +1,3 @@ +import { useEffect } from 'react'; + +export const UseMountEffect = (fun: Function) => useEffect(() => fun(), []); diff --git a/src/hooks/index.ts b/src/hooks/index.ts new file mode 100644 index 00000000..41928f94 --- /dev/null +++ b/src/hooks/index.ts @@ -0,0 +1,13 @@ +export * from './events'; +export * from './events/core'; +export * from './events/core/configuration'; +export * from './events/nitro'; +export * from './events/nitro/avatar'; +export * from './events/nitro/camera'; +export * from './events/nitro/communication'; +export * from './events/nitro/localization'; +export * from './events/nitro/room'; +export * from './events/nitro/session'; +export * from './events/ui'; +export * from './messages'; +export * from './UseMountEffect';