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

Backagain #1

Open
wants to merge 159 commits into
base: master
Choose a base branch
from
Open

Backagain #1

wants to merge 159 commits into from

Conversation

MarymagdalenaX
Copy link

jrdb and others added 30 commits February 8, 2016 17:53
Fix and test for issue #3961 - Collection#set - add events sends
options.index that correspond to wrong index
Fix and test for issue #3961 - Collection#set - add events sends
options.index that correspond to wrong index
fix and test for #3961 - add events sends options.index that correspond
to wrong index
 - modelId now takes the model in question as the second argument
 - modelId will look at the model in question's idAttribute before falling back to Collection.prototype.model.modelId and then 'id'
 - Makes basic polymorphic collection work out of the box while retaining backwards compatability
The event listener was missing a closing parenthesis in the preinitialize code sample for Collections.
Added missing parenthesis in the Collection preinitialize code example
Add check for `this.model.prototype`
Fixes #3882
Fixes #4159

Backbone does a bit of extra work to determine when to update `_byId` on every model change event because `change:id` will not work if `idAttribute` has changed.  This causes issues as the `change` event happens after every `change:` event which means during a change the `_byId` hasn't updated.  Rather than adding complexity to collection the solution is to have the model notify with the id changes.

If adding a public event isn't desired, for an internal solution the model is aware of it's collection and could modify model.collection._byId directly within the set.

Either of these solutions seem preferrable to handling `change:[idAttribute]`

Replaces the need for:
https://github.com/jashkenas/backbone/pull/4227/files#diff-c773bb9be277f0f3f2baa308b6e0f3a486790fe99fea81ddd0ba409846250571R1205
Replace Travis with GitHub Workflows
jgonggrijp and others added 30 commits January 23, 2024 19:48
I mean, not exactly to the letter of the comments, but hopefully to
the spirit.
Old trick learned from Underscore: within this directory, Node.js and
other tools that follow its awkward convention will be willing to
interpret .js files with ES module syntax.
Use allowed instead of whitelisted; Use disallowed instead of blacklisted;
Bump GitHub workflows to latest version
Trigger the "changeId" event only if prevId is different from this.id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.