Created
May 27, 2010 16:54
-
-
Save canonic-epicure/416044 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment