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
According to the readme: "The built-in types
String,Bool,Number,Elem, andEventare also supported. Additional user-defined types can be used by name (e.g.UserorPost). 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 truein 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