Skip to content

Instantly share code, notes, and snippets.

View adamesque's full-sized avatar

Adam Luikart adamesque

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
items: "one two three".w(),
actions: {
handleSelect(item) {
alert(item);
}
}
@adamesque
adamesque / component.js
Last active August 31, 2018 14:41
Ember Component Life-cycle Docs Feedback
import Ember from 'ember';
export default Ember.Component.extend({
/**
Overall thoughts: Ember.Component needs a section in the module doc block outlining the order of events (just like the 1.13 blog post).
Individual events can then refer back to that lifecycle chart to avoid the "runs xth during re-renders but only on thursdays" sentences.
The module doc block should also get the section on what triggers a re-render (from the 1.13 blog post).
*/
myProp: null,
@adamesque
adamesque / application.controller.js
Last active January 26, 2016 22:05
ToggleButton
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
isActive: false,
actions: {
toggle() {
this.toggleProperty('isActive');
}
}
@adamesque
adamesque / timeout.test.js
Last active November 8, 2017 17:16
Jest timeout explorations (AKA I don't understand timeouts) (AKA okay I figured it out)
async function wait(ms) {
return new Promise((resolve) => {
window.setTimeout(() => resolve(), ms);
});
}
describe('Jest Timeout test', () => {
beforeEach(() => {
// Calling `jest.setTimeout` simply mutates `jasmine.DEFAULT_TIMEOUT_INTERVAL`
jest.setTimeout(200);
@adamesque
adamesque / lockfiles-talk-references.md
Last active March 21, 2018 15:52
Lockfiles talk References