Skip to content

Shouldn't we permit NamedTypes without typechecking? #15

@JoshuaSCochrane

Description

@JoshuaSCochrane

According to the readme: "The built-in types String, Bool, Number, Elem, and Event are also supported. Additional user-defined types can be used by name (e.g. User or Post). Such types are treated opaquely by the type checker and will not check the fields of the object."

But we throw an exception for typechecking when we encounter user-provided NamedTypes - shouldn't we just return true in that case? Or have some mechanism to register type checkers? (one could dynamically append a key to runtimeCheckers with their own type I suppose..., e.g. runtimeCheckers["User"] = v => true;, but I'm not sure that's what's intended here)

https://github.com/efritz/arrows/blob/13be431cebd7681717b9390a3b4609ed54b4feb2/src/types.js#L104-L112

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions