为什么Backbone 1.0.0中的Collection.fetch()没有触发'reset'事件

Geo*_*ieF 2 backbone.js

我有一个带有followig代码的集合视图:

class FoosCollectionView extends Backbone.View
  el: '#foos'

  initialize: ->
    @collection = new FoosCollection [],
      barId: @options.barId
      foozId: @options.foozId

    @listenTo @collection, 'sync', @render
    @collection.fetch()

  template: MyApp.Templates.foos

  render: (event)->
    $(@el).html @template @collection
    @

FoosCollectionView
Run Code Online (Sandbox Code Playgroud)

在Backbone 1.0.0之前reset,fetch在集合完成时触发了一个事件.现在sync事件被触发,但我不知道这是由于错误还是新标准行为.

谁能告诉我,为什么reset不再触发?

问菲利克斯

Exo*_*ric 7

在1.0.0更改日志中,我看到:

重命名Collection的"更新"以设置,与类似的model.set()并行,并与reset对比.它现在是获取后的默认更新机制.如果您想继续使用"重置",请通过{reset:true}.