re-callable `trackedFunction`
I haven't tested this fully with tracking context yet but its a work in progress and i figured i'd open a draft pr.
I know it's not necessarily nice to put values on a function object, but i think the ergonomics of this approach are quite nice. I also played around a bit with putting a "re-execute" function onto the State but i had some problems with context and reassigning the values.
had some problems with context and reassigning the values.
I think we'll still want to explore putting things on the State class -- what problems were you running in to?
had some problems with context and reassigning the values.
I think we'll still want to explore putting things on the
Stateclass -- what problems were you running in to?
Out of curiosity, is it because of the API or maybe because the implementation is a bit messy?
Out of curiosity, is it because of the API or maybe because the implementation is a bit messy?
classes have way better type inference than the dynamic approach presently implemented in this PR. ember-resources is aiming for maximum Glint support with maximum type inference ability (yay!) :partying_face:
I see, that`s a very good argument :smile: .
I'm not really a typescript user and am more used to a more "functional" programming style so that's why i tried to implement it a bit more declarative and in a dynamic way.
I'll have a look again and put this into the State.
@NullVoxPopuli I implemented the function on the class as you proposed an the test is now green, feel free to have a look at this again :smile:
I gave a shot at this here: https://github.com/NullVoxPopuli/ember-resources/pull/665
thoughts?
Gonna close in favor of: https://github.com/NullVoxPopuli/ember-resources/pull/665
@velrest , thanks a ton for pushing this forward!