Created
August 20, 2016 02:51
-
-
Save zackthehuman/a0a43a8ec6abeb0d8d08c6e9688f96fa to your computer and use it in GitHub Desktop.
Contrived CP example
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
import Ember from 'ember'; | |
function makeCP(keys, cb) { | |
keys = keys.map(key => `someObj.${key}`); | |
const args = [...keys, cb]; | |
return Ember.computed(...args); | |
} | |
const someObj = { | |
thePeople: 'are real', | |
theCases: 'are real', | |
theRulings: 'are final' | |
}; | |
const theKeys = Object.keys(someObj); | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
foo: makeCP(theKeys, function() { | |
return this.get('someObj.thePeople'); | |
}), | |
someObj | |
}); |
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
{ | |
"version": "0.10.4", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.7.0", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "2.7.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment