View simple-dom.js
This file contains 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
/*******************************************/ | |
/* Version 1.0.0 */ | |
/* License MIT */ | |
/* Copyright (C) 2022 Devin Weaver */ | |
/* https://tritarget.org/cdn/simple-dom.js */ | |
/*******************************************/ | |
/** | |
* This micro lib is a compact and simple method to interact with the DOM. It | |
* facilitates the query mechanisms that querySelector and querySelectorAll use |
View controllers.application\.js
This file contains 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 { | |
flat = { | |
'some.nested.keys': 'flat' | |
}; | |
nested = { | |
some: { | |
nested: { |
View controllers.application\.js
This file contains 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'; | |
import { action } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
@tracked selected = 2; | |
get isSelected() { | |
// The {{get}} helper will coerce values to strings. Thus | |
// an POJO lookup works even if the type is a number. |
View components.my-component\.js
This file contains 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'; | |
export default class extends Component { | |
@tracked counter = 0; | |
constructor() { | |
super(...arguments); | |
this.startPolling(); | |
} | |
willDestroy() { |
View components.my-component\.js
This file contains 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'; | |
export default class extends Component { | |
@tracked counter = 0; | |
constructor() { | |
super(...arguments); | |
this.startPolling(); | |
} | |
willDestroy() { |
View controllers.application\.js
This file contains 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 { all, task } from 'ember-concurrency'; | |
export default class ApplicationController extends Controller { | |
@task({ maxConcurrency: 10, enqueue: true }) | |
*fetchCollection(item) { | |
return yield fakeResponse({ filename: item.filename }); | |
} |
View components.example-manager\.js
This file contains 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'; | |
const tasks = new WeakMap(); | |
class Task { | |
@tracked isLoading = true; | |
@tracked lastError; | |
@tracked result; |
View components.my-component\.js
This file contains 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'; | |
export default class extends Component { | |
@tracked trackedValue = ''; | |
get getterResult() { | |
return `Working '${this.trackedValue}' as expected.`; | |
} | |
} |
View controllers.application\.js
This file contains 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 { task, timeout } from 'ember-concurrency'; | |
export default class ApplicationController extends Controller { | |
@(task(function * () { | |
yield timeout(1000); | |
})) | |
fooTask; | |
get isLoading() { |
View components.text-markup\.js
This file contains 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 { | |
} | |
class EncodedText extends HTMLElement { | |
_state = 'encoded'; | |
get isEncoded() { | |
return this._state === 'encoded'; | |
} |
NewerOlder