#How to clear a store?
8 messages · Page 1 of 1 (latest)
I answered this here: #1173831851765411840 message
basically no straightforward way, but setStore(Object.keys(store), undefined) gets you there
Appreciate the answer even if the question is a dupe, it didn't show up in the search results before posting this one.
If useful, with TS would look like,
setState(Object.keys(state) as Array<keyof typeof state>, undefined);
I do setStore(reconcile({})) for that use case
This is what the new doc seems to recommend
https://docs.solidjs.com/references/api-reference/stores/using-stores#updating-stores
Amazing, thank you!