Skip to content

Instantly share code, notes, and snippets.

@ynotdraw
Last active July 3, 2018 14:49
Show Gist options
  • Save ynotdraw/f1de320c95d42ae94f1e6eea99ca3ca6 to your computer and use it in GitHub Desktop.
Save ynotdraw/f1de320c95d42ae94f1e6eea99ca3ca6 to your computer and use it in GitHub Desktop.
Ember RFC176 Import Snippets
// Copy and paste this as a JavaScript snippet. Follow the directionshere to access them:
// https://code.visualstudio.com/docs/editor/userdefinedsnippets
{
// ------------------------------
// Imports: getters/setters
// ------------------------------
"Import Getters/Setters": {
"prefix": "imp e get",
"body": [
"import { ${1:get}, ${2:getProperties}, ${3:set}, ${4:setProperties} } from '@ember/object';"
],
"description": "Imports getters and setters from @ember/object"
},
// ------------------------------
// Imports: services
// ------------------------------
"Import inject as service": {
"prefix": "imp e service",
"body": [
"import { inject as service } from '@ember/service';"
],
"description": "Imports `inject as service` from @ember/service"
},
// ------------------------------
// Imports: computeds
// ------------------------------
"Import Computed": {
"prefix": "imp e computed",
"body": [
"import { computed } from '@ember/object';"
],
"description": "Imports `computed` from @ember/object"
},
"Import Frequent Computeds": {
"prefix": "imp e computed all",
"body": [
"import { ${1:alias}, ${2:readOnly}, ${3:and}, ${4:bool} } from '@ember/object/computed';"
],
"description": "Imports frequently used computed modules"
},
"Import Computed ReadOnly": {
"prefix": "imp e computed readonly",
"body": [
"import { readOnly } from '@ember/object/computed';"
],
"description": "Imports `readOnly` from @ember/object/computed"
},
"Import Alias": {
"prefix": "imp e computed alias",
"body": [
"import { alias } from '@ember/object/computed';"
],
"description": "Imports `alis` from @ember/object/computed"
},
// ------------------------------
// Imports: run loop
// ------------------------------
"Import Frequent RunLoop": {
"prefix": "imp e runloop",
"body": [
"import { ${1:bind}, ${2:later}, ${3:run} } from '@ember/runloop';"
],
"description": "Imports frequently used runloop modules"
},
// ------------------------------
// Imports: ember-concurrency
// ------------------------------
"Import Frequent Concurrency": {
"prefix": "imp e concurrency",
"body": [
"import { ${1:task}, ${2:timeout} } from 'ember-concurrency';"
],
"description": "Imports frequently used ember-concurrency modules"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment