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
/** | |
* Utility type to replace a string with another. | |
*/ | |
type Replace<S extends string, R extends string, W extends string> = | |
S extends `${infer BS}${R}${infer AS}` | |
? Replace<`${BS}${W}${AS}`, R, W> | |
: S | |
/** | |
* Utility type to remove all spaces and new lines from the provided string. |
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
/* | |
Create a new polly instance. | |
Connect Polly to fetch. By default, it will record any requests that it | |
hasn't yet seen while replaying ones it has already recorded. | |
*/ | |
const polly = new Polly('Simple Example', { | |
adapters: ['fetch'], // Hook into `fetch` | |
persister: 'local-storage', // Read/write to/from local-storage | |
}); |
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
/* | |
Create a new polly instance. | |
Connect Polly to fetch. By default, it will record any requests that it | |
hasn't yet seen while replaying ones it has already recorded. | |
*/ | |
const polly = new Polly('Simple Example', { | |
adapters: ['fetch'], // Hook into `fetch` | |
persister: 'local-storage', // Read/write to/from local-storage | |
}); |
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'; | |
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
isValid: false, | |
isValidObserver: Ember.observer('model.validations.isValid', function() { | |
this.set('isValid', this.get('model.validations.isValid')); | |
}) |
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, timeout } from 'ember-concurrency'; | |
export default Ember.Component.extend({ | |
classNames: ['x-card'], | |
timeout: 500, | |
task: task(function *() { | |
yield timeout(this.get('timeout')); | |
}).on('didReceiveAttrs').restartable() |
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 { | |
get, | |
computed, | |
isArray, | |
A: emberArray | |
} = Ember; | |
const BufferedArrayProxy = Ember.ArrayProxy.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.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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
NewerOlder