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 Controller from '@ember/controller'; | |
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
export default class ApplicationController extends Controller { | |
async foo() { | |
await wait(5); | |
throw new Error("bla", { foo: 12 }); | |
} | |
} |
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 Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
rows = Array(200).fill(null).map(() => Array(100).fill(null).map(x => Math.random().toString().substr(2, 4))); | |
} |
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 Controller from '@ember/controller'; | |
const iterable1 = {}; | |
iterable1[Symbol.iterator] = function* () { | |
yield 1; | |
yield 2; | |
yield 3; | |
}; |
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 Controller from '@ember/controller'; | |
function Range(start, end) { | |
var ret = {}; | |
ret[Symbol.iterator] = function *() { | |
while (start < end) | |
yield start++; | |
} | |
return ret; | |
} |
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 Controller from '@ember/controller'; | |
function Range(start, end) { | |
var ret = {}; | |
ret[Symbol.iterator] = function *() { | |
while (start < end) | |
yield start++; | |
} | |
return ret; | |
} |
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 Controller from '@ember/controller'; | |
const data = (function *() { | |
yield 1; | |
yield 2; | |
})(); | |
export default class ApplicationController extends Controller { | |
data = data; | |
} |
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 Component from '@ember/component'; | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); | |
this.send('foo', "test"); | |
}, | |
actions: { | |
foo(arg) { | |
console.log(arg); |
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 Component from '@ember/component'; | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); | |
this.send('foo', "test"); | |
}, | |
actions: { | |
foo(arg) { | |
console.log(arg); |
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 Component from '@ember/component'; | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); | |
this.send('foo', "test"); | |
}, | |
actions: { | |
foo(arg) { | |
console.log(arg); |
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 Component from '@glimmer/component'; | |
import {action} from '@ember/object'; | |
import {tracked} from '@glimmer/tracking'; | |
export default class extends Component { | |
@tracked selected = []; | |
@action select(event) { | |
this.selected = [...this.selected, event.target.value]; | |
event.target.value = ""; | |
} | |
} |