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

Allow all (hash) keys to be set #1308

Merged
merged 1 commit into from
May 20, 2021

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented May 18, 2021

Enables setting all keys on a (hash). We do this by creating a
side-effecting cache which syncs the value of the key to the local state
whenever it is first accessed, and checking that cache on all subsequent
accesses. Whenever the upstream value has dirtied, the cache will rerun
and overwrite the local state of the hash.

When setting values on the hash with Ember.get and Ember.set, these
functions will get and set the tags associated with the proxy for
those keys. This is why customTagFor has been updated to get and
combine the tag for the proxy as well, for the time being.

@pzuraq pzuraq force-pushed the bugfix/allow-all-values-on-hash-to-be-set branch 4 times, most recently from 00d9a55 to 0fcb6aa Compare May 18, 2021 20:46
@pzuraq pzuraq force-pushed the bugfix/allow-all-values-on-hash-to-be-set branch from 0fcb6aa to c85a42b Compare May 19, 2021 23:49
Enables setting all keys on a `(hash)`. We do this by creating a
side-effecting cache which syncs the value of the key to the local state
whenever it is first accessed, and checking that cache on all subsequent
accesses. Whenever the upstream value has dirtied, the cache will rerun
and overwrite the local state of the hash.

When setting values on the hash with `Ember.get` and `Ember.set`, these
functions will get and set the tags associated with the _proxy_ for
those keys. This is why `customTagFor` has been updated to get and
combine the tag for the proxy as well, for the time being.
@pzuraq pzuraq force-pushed the bugfix/allow-all-values-on-hash-to-be-set branch from c85a42b to 2cbcabd Compare May 19, 2021 23:59
@pzuraq pzuraq merged commit 16acbd0 into master May 20, 2021
@pzuraq pzuraq deleted the bugfix/allow-all-values-on-hash-to-be-set branch May 20, 2021 00:06
@pzuraq pzuraq added the bug label May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants