benpickles / js-model

Work with models in your JavaScript
http://benpickles.github.io/js-model/
MIT License
403 stars 42 forks source link

Model.remove() passes instance as event argument #9

Closed ismasan closed 13 years ago

ismasan commented 13 years ago

Hey again Ben. I made it so destroying instances triggers 'remove' with the destroyed instance as an argument. This is so I can update my app via:

MyModel.bind('remove', function( removed_instance ){
    // remove removed_instance from UI, etc.
});

I needed this for our app, unless you have a better pattern for this kind of thing?l

benpickles commented 13 years ago

Thanks Ismael, this is included in v0.9.2.