This file contains hidden or 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 { State } from 'jumpsuit' | |
| const reducer = State({ | |
| // Initial State | |
| initial: { count: 0 }, | |
| // Actions | |
| increment (state, payload) { | |
| return { count: state.count + 1 } | |
| }, | |
| decrement (state, payload) { |
This file contains hidden or 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 { Effect, Actions } from 'jumpsuit' | |
| Effect('asyncIncrement', (time = 1000) => { | |
| setTimeout(() => Actions.increment(), time) | |
| }) |
This file contains hidden or 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 { Hook, Actions } from 'jumpsuit' | |
| Hook((action, getState) => { | |
| // Never letting the counter equal 10! | |
| if (getState().counter.count === 10) { | |
| Math.random() > 0.5 ? Actions.increment() : Actions.decrement() | |
| } | |
| }) |
This file contains hidden or 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 Jumpsuit | |
| import { Render, State, Effect, Hook, Actions, Component } from 'jumpsuit' | |
| // Create a state with some actions | |
| const CounterState = State({ | |
| // Initial State | |
| initial: { count: 0 }, |
This file contains hidden or 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
| // Javascript | |
| import { Render, Router, Route, Redirect, IndexRoute, IndexRedirect } from 'jumpsuit' | |
| Render(state, ( | |
| <Router> | |
| <Route path='/' component={Layout}> | |
| <IndexRoute component={Teams} /> | |
| <Route path='me' component={Me} /> | |
| <Route path='workspaces' component={Workspaces} /> | |
| <Route path='invite' component={WorkspaceInvite} /> |
This file contains hidden or 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 { State } from 'jumpsuit' | |
| import _ from 'lodash' | |
| import {FormDefaultProps} from 'react-form' | |
| const formState = State('react-form', { | |
| initial: {}, | |
| set (state, form) { | |
| return { | |
| ...state, | |
| [form.id]: form |
This file contains hidden or 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
| Solutions | |
| Modules | |
| Components | |
| Primitives | |
| <Path /> | |
| <Arc /> | |
| <Arc /> | |
| Responsive (Take up 100% of parent all the time) | |
| State => Visualization |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> /* set the CSS */ | |
| .bar { fill: steelblue; } | |
| </style> | |
| <body> | |
| <!-- load the d3.js library --> |
This file contains hidden or 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 React, { PropTypes } from 'react' | |
| import { Transition } from 'react-move' | |
| const RouteTransition = React.createClass({ | |
| propTypes: { | |
| pathname: PropTypes.string.isRequired | |
| }, | |
| render() { | |
| return ( |
This file contains hidden or 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
| license: gpl-3.0 |