
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);
      }
    }
  };
});


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').then(function(obj) {
          return obj.data;
        });
      },
      onChange: function (cb) {
        privateClient.on('change', cb);
      }
    }
  };
});

return obj.data in getNote promise