avoid GC in signal/effect
This commit is contained in:
1 parent
05ec3f468d
commit
2bcd072667
8 files changed
+92
-76
No files matched your search
@@ -13,7 +13,10 @@ test("createSignal", () => {
|
||||
|
||||
test("createEffect", () => {
|
||||
const [test, setTest] = createSignal("foo");
|
||||
const callback = vi.fn(test);
|
||||
const callback = vi.fn(() => {
|
||||
test();
|
||||
test();
|
||||
});
|
||||
|
||||
createEffect(callback);
|
||||
expect(callback).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in new issue
Block a user