Skip to content

Instantly share code, notes, and snippets.

View martletandco's full-sized avatar

Joshua Vermeulen martletandco

  • Melbourne, Australia
View GitHub Profile
@martletandco
martletandco / action-proxy-mixin.js
Created July 19, 2017 00:54
Ember: Proxy actions to plain methods
// Usable with Route, Controller, and Component (anything using `ActionHandler`)
export default Mixin.create({
// Could add to `mergedProperties`
actionsList: [],
// If an action isn't found on the `actions` hash then ActionHandler will check for a target with a send method
// The `computed` allows the correct `this` scope to be used when calling methods
target: computed(function() {
let send = (...args) => {
let methodName = args.shift();
@martletandco
martletandco / controllers.application.js
Last active April 4, 2017 11:26
ember-concurrency-batch-process
import Ember from 'ember';
import {task, timeout} from 'ember-concurrency';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
arg: 1,
batchedArgs: Ember.A([]),
results: Ember.A([]),