- 3 eggs
- 2/3 cup canned pumpkin
- 1 cup sugar
- 1 teaspoon of baking soda
- 1/2 teaspoon ground cinnamon
- 3/4 cup of flour
- see https://gist.github.com/machty/5723945 for the latest API (unlikely to change from now on)
- latest Ember build: https://machty.s3.amazonaws.com/ember/ember-async-routing-10.js
Lots of FPR libraries use Observables as their central async/concurrency primitive, so it'd be nice if ember-concurrency could integrate with these libraries.
Before delving into how this might be possible, here's a quick compare/contrast between e-c Tasks and Observables:
- Modeling Streams
- both e-c tasks and observables can async streams of zero or more values followed by an optional success/error termination
- observables emit values using
onNext()
,onCompleted()
, andonError()
- observables emit values using
- both e-c tasks and observables can async streams of zero or more values followed by an optional success/error termination
- tasks emit values using
emit()
, and returning a value from a generator fn is an implicitemit()
, and throwing an error is an implicitonError
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
get foo() { | |
return "i was returned from the getter foo"; | |
} | |
}); |
router.js Architecture
Let this serve as a guide for anyone who'd like to dig into router.js's internals, understand what's going on, and hopefully contribute!
router.js
is most popularly known as the routing microlib used by the
Ember.js Router, though other folk have been known to use it beyond
Ember, including some Angular folk who weren't satisfied with
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 Ember from 'ember'; | |
import { task, timeout, waitForProperty } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
count: 0, | |
foo: task(function() { | |
return { |
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
// Extend Ember.Route to add support for sensible | |
// document.title integration. | |
Ember.Route.reopen({ | |
// `titleToken` can either be a static string or a function | |
// that accepts a model object and returns a string (or array | |
// of strings if there are multiple tokens). | |
titleToken: null, |
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 Ember from 'ember'; | |
let guid = () => (Math.random().toString(36) + '00000000000000000').slice(2, 14) | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
vol: Ember.computed(function() { | |
return guid(); | |
}).volatile(), | |
actions: { |
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 Ember from 'ember'; | |
import { lifespan, subscription } from "../subscription"; | |
import { bind } from '@ember/runloop'; | |
import { task, timeout } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
chatRooms:[ "EmberChat", "ReactChat", "VueChat", "AngularChat"], | |
chatRoom: null, | |
// chatRoomName: null, |