Skip to content

Commit

Permalink
Update Complex.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
speigg committed May 16, 2024
1 parent f506584 commit ac337e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/__tests__/Complex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ test('scoped: should reinitialize when parent state changes', async () => {

test('should synchronize unsubscription and reinitialization when source/store changes', async () => {
const initialStore = hookstate(0);
const newStore = hookstate(1);
const newStore = hookstate(42);

let renderTimes = 0;
const { result, rerender } = renderHook(({ source }) => {
Expand All @@ -249,7 +249,7 @@ test('should synchronize unsubscription and reinitialization when source/store c
rerender({ source: newStore });

expect(renderTimes).toBe(3);
expect(result.current.get()).toBe(1); // Should reinitialize to new store's value
expect(result.current.get()).toBe(42); // Should reinitialize to new store's value
});

test('local: should reinitialize when initial state changes', async () => {
Expand Down

0 comments on commit ac337e2

Please sign in to comment.