Skip to content

Instantly share code, notes, and snippets.

@toranb
Last active August 11, 2016 05:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toranb/5c7fcf6c9d10093f9ca9 to your computer and use it in GitHub Desktop.
Save toranb/5c7fcf6c9d10093f9ca9 to your computer and use it in GitHub Desktop.
a FRP ember component using redux (yay)
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
import connect from 'ember-redux/components/connect';
var stateToComputed = (state) => {
return {
low: state.low,
high: state.high
};
};
var dispatchToActions = (dispatch) => {
return {
up: () => dispatch({type: 'UP'}),
down: () => dispatch({type: 'DOWN'})
};
};
var CountListComponent = Ember.Component.extend({
layout: hbs`
<span class="parent-state">{{low}}</span>
<button class="btn-up" onclick={{action "up"}}>up</button>
{{count-detail high=high down=(action "down")}}
`
});
export default connect(stateToComputed, dispatchToActions)(CountListComponent);
@devinrhode2
Copy link

So who wants to do some elm pair programming with me? It's totallyl the future! http://elm-lang.org
I think most of the smartest nerds have left javascript already.

Also I'm interested in trying to port elm-ui sass to elm. Cut one language out of the picture. Also need to port compass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment