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

Optional atom validate method in dev mode #16

Open
brinkokevin opened this issue Aug 8, 2024 · 0 comments
Open

Optional atom validate method in dev mode #16

brinkokevin opened this issue Aug 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@brinkokevin
Copy link
Contributor

To catch bugs where we pass the wrong state to an atom faster, it would be nice if we could pass a validator function to the atom's options table. For performance reasons this should only run in dev mode, _G.__DEV__ like react.

atom("John", {
     validate = t.string,
}) 
@littensy littensy added the enhancement New feature or request label Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants