Skip to content

Instantly share code, notes, and snippets.

Sergio Arbeo Serabe

Block or report user

Report or block Serabe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View components.my-component-nested.js
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['red'],
didInsertElement() {
window.nested = this;
}
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
click(evt) {
alert(`has stop propagation? ${'stopPropagation' in evt ? 'Yes' : 'No'}`);
}
});
@Serabe
Serabe / promises2.js
Last active Oct 26, 2018
Custom impl for Promise.all and Promise.race
View promises2.js
const callOnlyOnce = (fn) => {
let called = false;
return function() {
if (called) {
return;
}
called = true;
return fn.apply(this, arguments);
}
}
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'span',
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
foos: ['hello', 'goodbye', 'maybe'],
bar: 'maybe'
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
});
@Serabe
Serabe / controllers.application.js
Last active Jul 25, 2018
setup controller not being called
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
arr: Ember.A([]),
theLength: Ember.computed('arr[]', function() {
return this.get('arr').length;
}),
@Serabe
Serabe / components.my-component.js
Created Mar 23, 2018
Concatenated properties in contextual components
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['green-border']
});
You can’t perform that action at this time.