Skip to content

Commit

Permalink
remove TODO regarding throwing when mutableAtom is unmounted. mutable…
Browse files Browse the repository at this point in the history
…Atom supports updates when unmounted
  • Loading branch information
David Maskasky committed Oct 4, 2023
1 parent e38ad6e commit c916526
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions __tests__/mutableAtom.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ it('should rerender only when the proxy value changes', async () => {
expect(runCount).toBe(3)
})

it('should subscribe on mount, unsubscribe on unmount, and resubscribe on remount', async () => {
it('should handle updates correctly regardless of mount and unmount events', async () => {
expect.assertions(7)
const mutableCountAtom = mutableAtom(0)
let targetAtom = mutableCountAtom
Expand Down Expand Up @@ -84,7 +84,6 @@ it('should subscribe on mount, unsubscribe on unmount, and resubscribe on remoun
unmount()

await act(async () => result.current.countProxy.value++)
// TODO: should countProxy throw when mutableAtom is unmounted?
expect(result.current.countProxy.value).toBe(2)

remount()
Expand Down

0 comments on commit c916526

Please sign in to comment.