Last active
October 27, 2016 01:48
-
-
Save tzechienchu/b4e84092e2c466943b1a9eedc5c30db5 to your computer and use it in GitHub Desktop.
VSC Javascript snippet
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
{ | |
"coRoutine": { | |
"prefix": "coBody", | |
"body": [ | |
"co(function*() {", | |
" cb(null,'ToDo');", | |
"})", | |
".catch(function(err){", | |
" cb(null,{err:err});", | |
"})" | |
], | |
"description": "co body" | |
}, | |
"remoteMethod":{ | |
"prefix": "remoteBody", | |
"body": [ | |
"user.remoteMethod(", | |
" 'getUsersData',", | |
" {", | |
" http: {verb: 'get'},", | |
" accepts: [", | |
" {arg: 'ownerId', type: 'string', required: true, description:'onwerId'}", | |
" ],", | |
" returns: {arg: 'response', type: 'object'},", | |
" description:'Get userData from userId in an Array'", | |
" }", | |
")" | |
], | |
"description": "remoteMethod body" | |
}, | |
"singleton":{ | |
"prefix":"singleton", | |
"body":[ | |
"var DataGenerator = (function () {", | |
" var instance;", | |
" function init() {", | |
" return {", | |
" }", | |
" }", | |
" return {", | |
" getInstance: function () {", | |
" if ( !instance ) {", | |
" instance = init();", | |
" }", | |
" return instance;", | |
" }", | |
" };", | |
"})();", | |
"module.exports = DataGenerator;" | |
], | |
"description": "singleton body" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment