【文件属性】:
文件名称:backbone.turbo-where:带有索引的主干集合
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-05 14:51:18
JavaScript
骨干涡轮
使用索引更快地读取Backbone Collections。 索引将在集合reset计算,并在add , remove和change事件时更新。 它会覆盖给定集合对象中的where方法。 新的where方法将使用缓存的索引(如果存在),否则将执行常规的where方法。
例子
var MyCollection = Backbone . Collection . extend ( {
initialize : function ( ) {
TurboWhere . setupIndexes ( this , [ 'foreign_key' ] ) ; < = API
}
} ) ;
var my_collection = new MyCollection ( ) ;
my_collection . reset ( [
{ id : 1 , foreign_key
【文件预览】:
backbone.turbo-where-master
----.travis.yml(38B)
----.eslintrc(2KB)
----backbone.turbo-where.js(5KB)
----package.json(352B)
----test()
--------performance.js(1KB)
--------behavior.js(3KB)
----LICENSE(1KB)
----.gitignore(14B)
----README.md(2KB)