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
const TaskInput = () => { | |
let [inputValue, setInputValue] = useState(''); | |
let [perform, taskState] = useTask(function*(newInputValue) { | |
setInputValue(newInputValue); | |
yield timeout(1000); | |
if (newInputValue) { | |
return [newInputValue]; | |
} | |
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
const TaskInput = () => { | |
let shouldPerform = useRef(false); | |
let [inputValue, setInputValue] = useState(''); | |
let [perform, taskState] = useTask(function*() { | |
yield timeout(1000); | |
if (inputValue) { | |
return [`good ${inputValue}`, `better ${inputValue}`, `best ${inputValue}`]; | |
} | |
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
// Currently there is a gap in the API for supporting | |
// intecepting requests by specific order. An intercept() | |
// will call all intercept handlers registered against a route, in order. | |
// In some cases, you may want them to be order-specific. i.e., | |
// fire an intercept, when the next time the route is hit fire another. | |
// It can be achieved today with the current API, but it requires | |
// a bit of boilerplate and isn't trivial for those who don't understand | |
// the inner-workings of the API (it trolled Alex, and I didn't know immediately what | |
// the stacking behavior would be without looking through the docs/implementation). | |
// |
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 { run } from '@ember/runloop'; | |
import { action } from '@ember-decorators/object'; | |
import storageFor from 'os-workflows/utils/storage-for-decorator'; | |
const { assign } = Object; | |
export function withQueryParamMemory(Klass) { | |
return class WithQueryParams extends Klass { | |
@storageFor('route-memory') | |
_memory; |
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 { run } from '@ember/runloop'; | |
import Component from '@ember/component'; | |
import { action } from '@ember-decorators/object'; | |
import { task } from 'ember-concurrency-decorators'; | |
import { argument } from '@ember-decorators/argument'; | |
import { inject as service } from '@ember-decorators/service'; | |
import { layout, tagName } from '@ember-decorators/component'; | |
import { readOnly } from '@ember-decorators/object/computed'; | |
import { shapeOf } from '@ember-decorators/argument/types'; | |
import query from 'os-workflows/queries/fetch-tracker'; |
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 { task } from 'ember-concurrency'; | |
export default Controller.extend({ | |
setup: task(function*() { | |
yield delay(6000); | |
this.set('model', { message: '1' }); | |
yield delay(4000); | |
this.set('model', { message: '2' }); |
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', | |
init() { | |
this._super(...arguments); | |
this.objects = [ | |
{ label: 'First' }, |
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
function timeout(ms) { | |
return new Promise((resolve) => { | |
setTimeout(() => resolve(), ms); | |
}); | |
} | |
function blockCard(cardElement) { | |
const bio = cardElement.querySelector('.ProfileCard-bio'); | |
const blockStatus = cardElement.querySelector('.blocked'); |
NewerOlder