Skip to content

Optional atom validate method in dev mode #16

@brinkokevin

Description

@brinkokevin

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,
}) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions