-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
README.md missleading: Primitive Store can only be used with strings #44
Comments
Are you talking about this example: import { persistentAtom } from '@nanostores/persistent'
export const shoppingCart = persistentAtom<Product[]>('cart', [], {
encode: JSON.stringify,
decode: JSON.parse,
}) It has What exact problem do you have? |
I issued the same problem then i tried to use |
@ivan-suhorukov Do you use TypeScript? It should warn you. |
I've created a small project at https://codesandbox.io/p/github/RaphaelBossek/nanostores-persistent-example/main?file=%2Fsrc%2Fcounter.ts%3A16%2C1 for the TypeScript issue with the example: |
TS error looks good, it highlights need of encoding. How do you suggest changing the doc? |
The Primitive Store example and the explanation from README.md suggest that persistentAtom also allows types other than string, which is not the case for the type definition
The text was updated successfully, but these errors were encountered: