opal/vienna — pull request #7 by svoboda-jan (2013-04-30 09:59:13+00:00)
Title: Make storage event api consistent

@adambeynon Hi, just noticed the addition of Vienna::LocalStorage, but there are few event api inconsistencies between `Vienna::LocalStorage` and `Vienna::Ajax`.

I would suggest the following events, which this PR follows:

`:change` triggered (in `#update!` and `#destroy!`) for any change to models (create, update, destroy)

`:refresh` for `Vienna::Ajax` when `#fetch` is called

`:create` triggered on both model class and instance when new record is created

`:update` triggered on both model class and instance when a record is updated

`:destroy` triggered on both model class and instance when a record is removed

The use case for triggering events on both model class and instance is to be able to subscribe to updates/deletes/creates of specific model when for example waiting for it to be updated by the server and also be notified of any changes to certain model kind, when for example the the UI should be updated when a model of specified kind is created.