Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Ames-Messinger scottmessinger

View GitHub Profile
@scottmessinger
scottmessinger / route-application.js
Created Jun 12, 2020
Application route for delaying loading until components have finished.
View route-application.js
export default class ApplicationRoute extends Route {
model(params, transition) {
if (this.fastboot && this.fastboot.isFastBoot) {
let promise = new Promise((resolve, reject) => {
let poll = () => {
later(() => {
if (this.finder.inFlightRequests.length === 0 && this.query.inFlightQueriesCount === 0) {
scheduleOnce("afterRender", this, resolve)
View controllers.application\.js
import Controller from '@ember/controller';
import ArrayProxy from "@ember/array/proxy"
import PromiseProxyMixin from "@ember/object/promise-proxy-mixin"
import { all } from "rsvp"
import { computed } from "@ember/object"
const ArrayPromiseProxy = ArrayProxy.extend(PromiseProxyMixin)
export default class ApplicationController extends Controller {
ids = [1, 2, 3]
View controllers.application\.js
import Controller from '@ember/controller';
import {computed, get, action, set} from "@ember/object";
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@scottmessinger
scottmessinger / controllers.application\.js
Last active Apr 1, 2020
Problem using map and tracked properties
View controllers.application\.js
import Controller from '@ember/controller';
import {action, set, get} from "@ember/object";
import {tracked} from "@glimmer/tracking";
import {
TrackedObject,
TrackedArray
} from 'tracked-built-ins';
export default class ApplicationController extends Controller {
View SketchSystems.spec
Group Payment Flow
trial
request-quote -> awaiting-purchase-order
request-invoice -> awaiting-payment
expired -> trial-expired
trial-expired
request-quote -> awaiting-purchase-order
request-invoice -> awaiting-payment
expired -> group-closed
awaiting-purchase-order
View SketchSystems.spec
Group Payment Flow
trial-new
expired -> trial-expired
credit-card -> paid-up
request-po -> trial-awaiting-payment
trial-expired
expired -> group-closed
trial-awaiting-payment
expired -> group-closed
payment-received -> paid-up
View SketchSystems.spec
Sign up
Name and email*
Next -> Step 2 how planbooks work
Step 2 how planbooks work
Next -> Step 3 planbook title and year
Step 3 planbook title and year
Next -> Step 4 Share with group
Next if not part of a group -> Planbook Setup
Step 4 Share with group
Next -> Planbook Setup
@scottmessinger
scottmessinger / process.rb
Created Jul 15, 2015
Importer with Transproc
View process.rb
preprocessor = Preprocessor.build
processor = Processor.build
evaluator = InputFunctions[:eval_values, [{ 'jd' => 'jd001' }]]
create_authors_with_books = rom.command([
:authors, [:create, [:books, [:create]]]
])
View enhancers.index.js
import { compose } from 'redux';
var devtools = window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f;
var composed = compose(devtools);
window.__REDUX_DEVTOOLS_EXTENSION__.open();
export default composed
View components.a-child.js
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs(){
this._super(...arguments)
console.log('didReceiveAttrs', 'a-child')
}
});
You can’t perform that action at this time.