This file contains hidden or 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
| Promise.resolve(1) | |
| .then( x => x + 1 ) | |
| .then( x => {throw 0} ) | |
| .catch( _ => 1 ) | |
| .then( x => x + 1 ) | |
| .then( x => console.log(x) ) | |
| .catch( console.error ) |
This file contains hidden or 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
| // util script for the example to illustrated worker module usage | |
| function TreeNode(left, right) { | |
| this.left = left; | |
| this.right = right; | |
| } | |
| function itemCheck(node) { | |
| if (node.left === null) { | |
| return 1; | |
| } |
This file contains hidden or 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
| // link to requireWorker.js script somewhere | |
| // <script src=requireWorker.js></script> | |
| const ums = requireWorker('example_ums.js') | |
| ums.createUser('email@domain.com', 'password', (err, user) => { | |
| console.log('User created') | |
| }) |
This file contains hidden or 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
| /** | |
| * | |
| * @param profileId | |
| * @param parentId | |
| * @param items | |
| * @returns {*} | |
| */ | |
| async addToList(profileId, label, parentId, { items }) { | |
| if (!validator.isUUID(id, 4) || !validator.isUUID(profileId, 4)) { | |
| throw new InvalidUuidError(); |
NewerOlder