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'; | |
| import EmberObject, { computed, defineProperty, get, action } from '@ember/object'; | |
| import { alias } from '@ember/object/computed'; | |
| import { camelize } from '@ember/string'; | |
| import { A } from '@ember/array'; | |
| const ATTR_MODEL_PREFIX = '_model_'; | |
| function computedAttrs() { | |
| const attrsList = EmberObject.create({}); | |
| const data = this.metaAttributes.reduce( |
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'; | |
| import { alias } from '@ember/object/computed'; | |
| import EmberObject, { computed } from '@ember/object'; | |
| import { A } from '@ember/array'; | |
| const AttributeModel = EmberObject.extend({ | |
| countAdditives: alias('additives.length'), | |
| additives: A() | |
| }); |
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'; | |
| import { action } from '@ember/object'; | |
| import { inject as service } from '@ember/service'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Twiddle'; | |
| @service('store') store; | |
| constructor() { | |
| super(...arguments); | |
| this.setup(); |
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'; | |
| import { action } from '@ember/object'; | |
| import { inject as service } from '@ember/service'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Twiddle'; | |
| @service('store') store; | |
| constructor() { | |
| super(...arguments); | |
| this.setup(); |
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 { createTemplate, setComponentTemplate, templateOnlyComponent } from '@glimmer/core'; | |
| export default setComponentTemplate( | |
| createTemplate(`<h1 ...attributes>AMA LAZY [{{@name}}]</h1>`), | |
| templateOnlyComponent() | |
| ); |
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'; | |
| import { action } from '@ember/object'; | |
| import { tracked } from '@glimmer/tracking'; | |
| export default class ApplicationController extends Controller { | |
| @tracked | |
| fragment = null; | |
| @tracked | |
| items = new Array(1000).fill(null).map((el,index)=>{ | |
| return { | |
| time: Date.now(), |
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'; | |
| import { tracked } from '@glimmer/tracking'; | |
| export default class ApplicationController extends Controller { | |
| constructor() { | |
| super(...arguments); | |
| class TempObject { | |
| @tracked foo; | |
| } | |
| const instance = new TempObject(); | |
| const { get } = Object.getOwnPropertyDescriptor(instance.__proto__, 'foo'); |
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 { tracked } from '@glimmer/tracking'; | |
| import { tracked as trackedAny } from 'tracked-built-ins'; | |
| const IS_REF = Symbol("IS_REF"); | |
| class TrackedRef { | |
| [IS_REF] = true; | |
| constructor(initialValue) { | |
| this.value = initialValue; | |
| } | |
| @tracked value; |
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'; | |
| export default class extends Component { | |
| get names() { | |
| const items = []; | |
| console.log(Reflect.ownKeys(this.args)); | |
| for (let key of this.args) { | |
| items.push(key); | |
| } | |
| return items.join(','); |
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'; | |
| import EmberObject, { action, computed as emberComputed } from '@ember/object'; | |
| let currentAutoTrack; | |
| function trackedData(key, initializer) { | |
| let values = new WeakMap(); | |
| let autoTrackingData = new WeakMap(); | |
| let hasInitializer = typeof initializer === 'function'; |