This is a very trivial example of using mirage with Ember Twiddle.
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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
import Ember from 'ember'; | |
const {computed} = Ember; | |
let aCount = 0; | |
let bCount = 0; | |
let stableComputedKey = 0; | |
function stableComputed(...dependentKeys) { | |
let func = dependentKeys.pop(); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
checkItem: Ember.computed('items.firstObject.bar.[]', function () { | |
return this.get('items.firstObject.bar.firstObject.test') | |
}), | |
nonCompute: null, | |
actions: { | |
doStuff() { |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
foo: { | |
'app.name': 'Ember Twiddle' | |
} | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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
import Ember from 'ember'; | |
import DS from 'ember-data' | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
foo: Ember.computed(() => { | |
return DS.PromiseObject.create({ | |
promise: new Promise(function(resolve) { | |
setTimeout(() => {resolve({bar: 42})}, 2000) | |
}) | |
}) |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
clicked () { | |
this.fooAction('foo') | |
} | |
} | |
}); |
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
import Ember from 'ember'; | |
import { task } from 'ember-concurrency'; | |
function change() { | |
this.set('appName', 'blam') | |
} | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
foo: Ember.computed('appName',function () { | |
// this.set('appName', 'blam') | |
this.get('bar').perform() |