
remoteStorage.defineModule('notes', function(privateClient, publicClient) {
  return {
    exports: {
      setNote: function (text) {
        return privateClient.storeFile('text/plain', 'note.txt', text);
      },
      getNote: function (cb) {
        privateClient.getFile('note.txt').then(function(obj) {
          cb(obj.data);
        });
      },
      onChange: function (cb) {
        privateClient.on('change', cb);
      }
    }
  };
});


remoteStorage.defineModule('notes', function(privateClient, publicClient) {
  return {
    exports: {
      setNote: function (text) {
        return privateClient.storeFile('text/plain', 'note.txt', text);
      },
      getNote: function () {
        return privateClient.getFile('note.txt');
      },
      onChange: function (cb) {
        privateClient.on('change', cb);
      }
    }
  };
});

return the promise in getNote