Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Class('DataStore.Sync', {
  2.  
  3. methods : {
  4.  
  5. log : function () {
  6. var response = // somehow get the response from logging operation
  7.  
  8. return response
  9. },
  10.  
  11.  
  12. save : function () {
  13. this.log()
  14.  
  15. var response = // somehow get the response from saving operation
  16.  
  17. if (response.err) throw response.err
  18.  
  19. return response
  20. }
  21. }
  22. })
  23.  
  24.  
  25. var store = new DataStore.Sync
  26.  
  27. try {
  28. var response = store.save()
  29. } catch (e) {
  30. // do smth
  31. } finally {
  32. // do smth
  33. }
Add Comment
Please, Sign In to add comment