Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
peternandersson committed Sep 18, 2024
1 parent cdecf54 commit d50d609
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/react/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ export function useActionEffect(configId: string, effect: () => void) {
const effectRef = useRef(effect);

useEffect(() => {
const unsubscribe = client.config.registerEffect(
configId,
effectRef.current,
);
return unsubscribe;
effectRef.current = effect;
});

useEffect(() => {
return client.config.registerEffect(configId, effectRef.current);
}, [client, configId, effect]);
}

0 comments on commit d50d609

Please sign in to comment.