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
can/map/define doesn't work more than one level deep. #1346
Comments
+1 |
This is actually pretty easy to implement: if define is present, make a constructor and make it Type. I can't help but wonder though, if this offers any advantage over just using Type. It actually makes things a little bit awkward, as you can't do instanceof tests, and it encourages insane nesting. |
@Bajix The advantage it offers is a simpler and obvious syntax. We can already use type...if we extend a map. For lack of a better phrase...that's pretty poopy. I don't want to have to go through that trouble just to define an object within my map. |
Fair enough. I can put together a PR for this if someone wants to assign it to me. |
No need, I forgot to assign this to myself. @akagomez and I already worked on this, he is going to work on the doc updates. |
This is a big problem with an easy fix. As it stands the define plugin only works one level deep; however, I've run into a lot of people express desire to have it work multiple levels deep. @akagomez and I already have this working with the following syntax:
Just as all Map instances have a define property, all nested objects should have one as well which define it's attributes as well.
Pretty excited to get this committed. Need to write a test and docs first though.
The text was updated successfully, but these errors were encountered: