Skip to content

Commit 6096a1d

Browse files
committed
fix(service): Infinite loop
1 parent 750f9da commit 6096a1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/templates/exportService.hbs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{>header}}
22

3+
import { useCallback, useMemo } from 'react';
34
import { atom, useAtom, SetStateAction } from 'jotai';
45

56
{{#if runtimeValidation}}
@@ -178,10 +179,11 @@ export function {{{hookName}}}(): [
178179
}
179180
});
180181
};
181-
const controller = {
182+
}, [resultState]);
183+
const controller = useMemo({
182184
fetchData,
183185
setter,
184-
};
186+
}, [fetchData, setter]);
185187
return [
186188
resultState,
187189
controller

0 commit comments

Comments
 (0)