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
/** | |
* A higher order function that takes a reducer and an extension | |
* and returns a reducer amplified with provided extensions on | |
* existing or new action types. | |
* | |
* Extensions are objects containing the action `type` attribute | |
* and an `actionTypeExtension` function which takes `state` and | |
* the `action` and must return an object to append to the reducer's | |
* new state. | |
* |
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
const mock = impl => { | |
const mockFn = (...args) => { | |
mockFn.calls.push(args); | |
return impl ? impl(...args) : undefined; | |
}; | |
mockFn.calls = []; | |
mockFn.reset = () => mockFn.calls = []; | |
return mockFn; |
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
Hey, | |
This is the redux video series that helped me learn how to use it: https://egghead.io/courses/getting-started-with-redux. And here's a section on react "stateless functions": https://facebook.github.io/react/docs/reusable-components.html#stateless-functions | |
Later you might want to play around with React Native | |
React Native for Web: https://github.com/necolas/react-native-web | |
Try it out here: http://codepen.io/necolas/pen/PZzwBR/?editors=0010 | |
And I thought you might get some ideas from what we're doing for mobile.twitter.com, which is a bit like this... |