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

Make sure it works with can-data-types #3

Closed
matthewp opened this issue May 9, 2019 · 4 comments · Fixed by #26
Closed

Make sure it works with can-data-types #3

matthewp opened this issue May 9, 2019 · 4 comments · Fixed by #26
Assignees

Comments

@matthewp
Copy link
Contributor

matthewp commented May 9, 2019

You should be able to do:

class Thing extends DefineClass {
  static define = {
    age: types.Number
  }
}
@matthewp
Copy link
Contributor Author

matthewp commented May 10, 2019

can-data-types contains some maybe types like MaybeString. We had talked about changing this to something like:

class Person extends DefineClass {
  static define = {
    age: types.strict(Number)
  }
}

How will we do strict types though? Should there be a types.coerce() and types.strict() method on can-data-types?

@matthewp
Copy link
Contributor Author

Would like your thoughts on the above @justinbmeyer 👆

@matthewp
Copy link
Contributor Author

Working on this, but blocked on canjs/can-reflect#162 at the moment.

@matthewp
Copy link
Contributor Author

Not actually blocked by the above.

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

Successfully merging a pull request may close this issue.

1 participant