ability to specify a type for derived properties - #116
Conversation
|
Hey @flipside, thanks for submitting this! I think I'm heading towards +1 on this idea. I've a couple of thoughts though - forgive me if I'm being slow. First up: what does |
|
@latentflip, by my read it looks like |
|
@aaronmccall @latentflip i wasn't sure if it should always automatically set a derived property on load if a type is set so I made them separate params. i'm open for init to default to true when a type is specified but i can imagine situations where it would be important to override. |
|
the other thing worth discussing is that since this approaches uses dataType, should it go all the way with using get/set/default and not just compare? |
|
adding support for default and the rest of the dataType functions turned out to be easy and didn't break tests so i added them. |
There was a problem hiding this comment.
Any reason we're getting rid of flushCache?
There was a problem hiding this comment.
I'm guessing cos it's not used. Doesn't appear to be being used by any other modules as per a github search. What do you think about removing it @HenrikJoreteg? Can you remember if it's useful/needed?
There was a problem hiding this comment.
I know at one point or another i wanted to be able to do this forcibly. But can't remember why. If it's not being used and everything passes, then we're probably good.
|
one debatable part is supporting |
By specifying a dataType for derived properties, a derived property with
type:"state"can dynamically have listeners updated when it returns a different state.Derived types also allow for custom behavior by adding new dataTypes.