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
[ | |
{"name": "Afghanistan", "code": "AF"}, | |
{"name": "Åland Islands", "code": "AX"}, | |
{"name": "Albania", "code": "AL"}, | |
{"name": "Algeria", "code": "DZ"}, | |
{"name": "American Samoa", "code": "AS"}, | |
{"name": "AndorrA", "code": "AD"}, | |
{"name": "Angola", "code": "AO"}, | |
{"name": "Anguilla", "code": "AI"}, | |
{"name": "Antarctica", "code": "AQ"}, |
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 { | |
example = `This | |
message | |
seems | |
to | |
split | |
correctly`; | |
} |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 from '@ember/object'; | |
const FOO = { bar: 'BAR' }; | |
class Foobar extends EmberObject { | |
baz = FOO.bar; | |
} | |
export default class ApplicationController extends Controller { |
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 { | |
} |
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'; | |
import { action, computed } from '@ember/object'; | |
// Ember 3.18.1 | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; // NOT Tracked | |
@computed('appName') // Dirty Dependancy | |
get foo1() { | |
return `${this.appName}-1`; |
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, notifyPropertyChange } from '@ember/object'; | |
let currentAutoTrackings = []; | |
function trackedData(key, initializer) { | |
let values = new WeakMap(); | |
let autoTrackingData = new WeakMap(); | |
let hasInitializer = typeof initializer === 'function'; | |
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 } from '@ember/object'; | |
function trackedData(key, initializer) { | |
let values = new WeakMap(); | |
let hasInitializer = typeof initializer === 'function'; | |
function getter(self) { | |
let value; | |
if (hasInitializer && !values.has(self)) { |
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 } from '@ember/object'; | |
const PROPERTY_BAG = Symbol('PROPERTY_BAG'); | |
function legacyTrackedVanilla(target, key, descriptor) { | |
target[PROPERTY_BAG] = target[PROPERTY_BAG] ?? EmberObject.create(); | |
target[PROPERTY_BAG].set(key, descriptor.initializer?.()); | |
descriptor.get = function() { | |
console.log(1); // NEVER CALLED |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |