Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Beale mixonic

View GitHub Profile
@mixonic
mixonic / components.my-component.display-part.js
Created May 16, 2019
Component with re-usable content components
View components.my-component.display-part.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
root: 'aa',
appName: Ember.computed('root', {
get() {
return this.get('root');
},
set(key, value) {
let newValue = value;
@mixonic
mixonic / controllers.application.js
Created May 3, 2019
Named export, default import
View controllers.application.js
import Ember from 'ember';
import NamedExports from './exporting';
export default Ember.Controller.extend({
appName: NamedExports.appName
});
View components.inner-component.js
import Ember from 'ember';
export default Ember.Component.extend({
log: Ember.computed(() => []),
open() {
this.get('log').pushObject('opened!');
},
didInsertElement() {
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
function noOverride () {
// cannot override
}
const Parent = Ember.Controller.extend({
init() {
this._super();
if (this.__proto__.noOverride !== noOverride) {
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>set-function-prop-var</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
View gist:65e9bb8ee2327bdd5b148d97f8949ffe
musicat@0.0.1 /Users/mixonic/Clients/rabble/musicat-stem
├── abbrev@1.0.9
├── acorn@3.3.0
├─┬ ajv@4.11.6
│ └─┬ json-stable-stringify@1.0.1
│ └── jsonify@0.0.0
├── amdefine@1.0.1
├── ansi-regex@2.0.0
├── anymatch@1.3.0
├── aproba@1.0.4
@mixonic
mixonic / readme.md
Last active Apr 21, 2021
Services for Glimmer.js
View readme.md

Setup

In config/environment.js:

// config/environment.js
'use strict';

/*
 * Mostly this is the stock module config.