-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
triagePending triage by a maintainer to give it proper labelsPending triage by a maintainer to give it proper labels
Description
Describe the bug
It is not possible to remove the value of a PersistedState thats possibly null or undefned. Setting its value to either null or undefined does not update either the value inside the storage nor the state it self.
Reproduction
const state = new PersistedState<{test: string} | null>(
`${INITIAL_FILTER_STATE_KEY}-${viewId}`,
null,
{
storage: 'session'
}
);
// state.current is now null
state.current = {test: "string"}
// state.current is now {test: "string"}
state.current = null
// state.current is now still {test: "string"} and thats the value in session storage as wellLogs
System Info
System:
OS: macOS 26.0.1
CPU: (10) arm64 Apple M2 Pro
Memory: 112.50 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.15.0 - /Users/andersrobstad/.nvm/versions/node/v22.15.0/bin/node
npm: 10.9.2 - /Users/andersrobstad/.nvm/versions/node/v22.15.0/bin/npm
pnpm: 10.15.1 - /Users/andersrobstad/Library/pnpm/pnpm
Browsers:
Brave Browser: 137.1.79.118
Chrome: 142.0.7444.162
Edge: 142.0.3595.80
Firefox: 138.0.4
Safari: 26.0.1Severity
annoyance
Metadata
Metadata
Assignees
Labels
triagePending triage by a maintainer to give it proper labelsPending triage by a maintainer to give it proper labels