AmpersandJS / ampersand-model

Observable objects, for managing state in applications.
MIT License
84 stars 31 forks source link

beforeSend is never called #36

Closed herkyl closed 9 years ago

herkyl commented 9 years ago

When defining a beforeSend in the ajaxConfig it never gets called

herkyl commented 9 years ago

I noticed when I delegate the model's sync function to ampersand-sync beforeSend gets called

Model = require 'ampersand-model'
sync = require 'ampersand-sync'

model = Model.extend

  ajaxConfig:
    beforeSend: ->
      debugger

  sync: ->
    sync.apply @, arguments
adamyonk commented 9 years ago

Getting ampersand-sync to a more recent version fixed this same issue for me. Has to do with AmpersandJS/ampersand-sync#23.