Skip to content

Instantly share code, notes, and snippets.

Avatar

Jordan Hawker elwayman02

View GitHub Profile
View components.nav-dropdown-item\.js
import Component from '@ember/component';
import { action, computed } from '@ember/object';
export default class extends Component {
element = null;
visibleTabItems = [];
visibleDropdownItems = [];
constructor({ visibleDropdownItems, visibleTabItems }) {
super(...arguments);
View components.foo-bar\.js
import Component from '@glimmer/component';
export default class extends Component {
}
View components.my-component\.js
import Component from '@ember/component';
export default Component.extend({});
@elwayman02
elwayman02 / sinon-examples.js
Created Sep 6, 2019
Ember Sinon Cleanup Examples
View sinon-examples.js
// ember-sinon-qunit (New)
// test-helper.js
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import Application from '../app';
import config from '../config/environment';
import setupSinon from 'ember-sinon-qunit';
setApplication(Application.create(config.APP));
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
foo: 'foo',
bar: 'bar'
});
View components.list-controls.js
import Ember from 'ember';
import layout from 'app/templates/components/list-controls';
export default Ember.Component.extend({
layout,
move: null,
actions: {
itemMoved() {
View .slate.js
// Based on https://github.com/jigish/dotfiles/blob/master/slate.js
// Configs
S.cfga({
"defaultToCurrentScreen" : true,
"secondsBetweenRepeat" : 0.1,
"checkDefaultsOnLoad" : true,
"focusCheckWidthMax" : 3000,
"orderScreensLeftToRight" : true
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('bar', {});
this.set('keys', Object.keys(Ember.get(this, 'bar')));
},
actions: {
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('bar', { foo: 'stuff' });
},
actions: {
foo() {
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('bar', { foo: 'stuff' });
},
actions: {
foo() {
You can’t perform that action at this time.