-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Autotracking Memoization #615
Conversation
Looks good. Solves my usages of observes, for example playing a video element on a data change. |
This should be a decorator? |
@BryanCrotaz no, this is meant to be a low-level API only. Decorators like |
Couple minor typos in the first line of the usage section: |
Co-Authored-By: Scott Ames-Messinger <scott@commoncurriculum.com>
We discussed this in todays core team meeting, and are moving it into final comment period. Time to read through it again! 😸 👓 🤓 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this RFC and well written. Some of the low level primitives that have been exposed recently have been immensely useful. So along the same track, this seems like a great idea!
Co-authored-by: Robert Jackson <me@rwjblue.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the isCache
API for now (if we have a use case that comes up later, we can definitely add it).
Co-authored-by: Robert Jackson <me@rwjblue.com>
For historical reference: I was momentarily worried that this RFC doesn't provide an easy way to check whether a computation is const without creating unnecessary garbage. This problem isn't semantic: it's not a semantic problem to create a @pzuraq persuaded me that the current spec allows this implementation: the implementation could check to see if the computation is This whole thing only matters if the cost of storing the cache momentarily is a notable cost. If it turns out to be a serious issue, and @pzuraq's thinking turns out to be wrong, we could always revisit this issue. |
FYI - @pzuraq created a polyfill for this that works back to ember-source@3.13 (going further back is very very difficult since autotracking in general is missing). Check it out https://github.com/ember-polyfills/ember-cache-primitive-polyfill |
Rendered