avoid GC in signal/effect
This commit is contained in:
@@ -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