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
Parse.Cloud.beforeSave('History', req => { | |
// logic will only get called if req.master is false | |
},{ | |
skipWithMasterKey:true | |
}); |
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
Parse.Cloud.beforeSave(Parse.User, () => { | |
// any additional beforeSave logic here | |
}, { | |
fields: { | |
accType: { | |
default: 'viewer', | |
constant: true | |
}, | |
}, | |
}); |
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
subscription.on('open', async () => { | |
console.log('subscription opened'); | |
todos = {}; | |
todos = (await query.find()).reduce((todos, todo) => ({ | |
...todos, | |
[todo.id]: todo | |
}), todos); | |
printTodos(); | |
}); |
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
let todos = {}; |
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
subscription.on('close', () => { | |
console.log('subscription closed'); | |
}); |
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
subscription.on('delete', todo => { | |
console.log(`todo ${todo.id} deleted`); | |
}); |
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
subscription.on('leave', todo => { | |
console.log(`todo ${todo.id} left`); | |
}); |
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
subscription.on('enter', todo => { | |
console.log(`todo ${todo.id} entered`); | |
}); |
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
subscription.on('update', todo => { | |
console.log(`todo ${todo.id} updated`); | |
}); |
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
subscription.on('create', todo => { | |
console.log(`todo ${todo.id} created`); | |
}); |