Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class('DataStore.Sync', {
- methods : {
- log : function () {
- var response = // somehow get the response from logging operation
- return response
- },
- save : function () {
- this.log()
- var response = // somehow get the response from saving operation
- if (response.err) throw response.err
- return response
- }
- }
- })
- var store = new DataStore.Sync
- try {
- var response = store.save()
- } catch (e) {
- // do smth
- } finally {
- // do smth
- }
Add Comment
Please, Sign In to add comment