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 { TrackedWeakMap } from 'tracked-built-ins'; | |
| function localCopy(target, key) { | |
| let values = new TrackedWeakMap(); | |
| let lastValues = new WeakMap(); | |
| return { | |
| get() { | |
| let incoming = this.args[key]; | |
| let lastValue = lastValues.get(this); |
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 { get, notifyPropertyChange } from '@ember/object'; | |
| export function inLocalStorage( | |
| target, | |
| propertyKey, | |
| descriptor | |
| ) { | |
| const targetName = target.constructor.name; | |
| const { initializer } = descriptor; |
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 { createTag, dirtyTag, consumeTag } from '@glimmer/tracking/tags'; | |
| export function inLocalStorage( | |
| target, | |
| propertyKey, | |
| descriptor | |
| ) { | |
| const targetName = target.constructor.name; | |
| const key = `${targetName}-${propertyKey}`; |
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
| ## Earth and Moon | |
| Terra | |
| Gaia | |
| Luna | |
| ## Planets | |
| Mercury | |
| Venus |
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 showDD = false; | |
| @tracked selectedFilters = []; | |
| get unselectedFilters() { | |
| return this.args.options.filter(f => !this.selectedFilters.includes(f)); |
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
| class FetchTask { | |
| @tracked isLoading = true; | |
| @tracked result; | |
| constructor(url) { | |
| this.run(url); | |
| } | |
| async run(url) { | |
| let response = await fetch(url); |
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 { inject as service } from '@ember/service'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Twiddle'; | |
| transitionToQp = () => { | |
| this.router.transitionTo({ queryParams: { foo: 123 } }); | |
| } | |
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 { schedule } from '@ember/runloop'; | |
| import { action } from '@ember/object'; | |
| import { tracked } from 'tracked-built-ins'; | |
| import { cached, trackedReset } from 'tracked-toolbox'; | |
| export default class extends Component { | |
| @trackedReset('args.checked') children = tracked([]); | |
| constructor() { |
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 { | |
| appName = 'Ember Twiddle'; | |
| } |