Collection #getId() renamed to getKey().
This commit is contained in:
parent
160522c520
commit
d4d8ea6cf2
@ -57,7 +57,7 @@ export default class Collection extends EventEmitter {
|
||||
this._size = 0
|
||||
}
|
||||
|
||||
getId (item) {
|
||||
getKey (item) {
|
||||
return item && item.id
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ export default class Collection extends EventEmitter {
|
||||
return [keyOrObjectWithId]
|
||||
}
|
||||
|
||||
const key = this.getId(keyOrObjectWithId)
|
||||
const key = this.getKey(keyOrObjectWithId)
|
||||
this._assertValidKey(key)
|
||||
|
||||
return [key, keyOrObjectWithId]
|
||||
|
@ -7,7 +7,7 @@ import View from './view'
|
||||
|
||||
// Create the collection.
|
||||
const users = new Collection()
|
||||
users.getId = (user) => user.name
|
||||
users.getKey = (user) => user.name
|
||||
|
||||
// Inserts some data.
|
||||
users.add({
|
||||
|
Loading…
Reference in New Issue
Block a user