Skip to content
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

Possible mistake in /content/docs/usage/observable.mdx #23

Closed
SzymonNastaly opened this issue Nov 19, 2024 · 1 comment
Closed

Possible mistake in /content/docs/usage/observable.mdx #23

SzymonNastaly opened this issue Nov 19, 2024 · 1 comment

Comments

@SzymonNastaly
Copy link

I have just started learning legend-state. I think I found a small mistake in the documentation:
Right now str$ is not used anywhere in the linked observable. Shouldn't the instances of arr$ be replaced with str$?

Or it could be used to automatically deserialize/serialize a string value.
```js
const str$ = observable('[1,2,3]')
const arr$ = observable(linked({
get: () => JSON.parse(arr$.get())
set: (value) => arr$.set(JSON.stringify(value))
}))
```

@jmeistrich
Copy link
Collaborator

Thanks! Fixed, and will publish an update to the site shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants