By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
import { combineReducers } from 'redux'; | |
import users from './reducers/users'; | |
import posts from './reducers/posts'; | |
export default function createReducer(asyncReducers) { | |
return combineReducers({ | |
users, | |
posts, | |
...asyncReducers | |
}); |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
Some steps I'm taking to debug bad performance with reselect.
My performance problems are coming from the fact that I am not using reselect properly. I wrote a bunch of selectors that use props but don't do anything to make sure they can be shared across multiple components.
The fix for this is: https://github.com/reactjs/reselect/blob/fec65b63b9a2ffa570348271138d20cf831e0185/README.md#sharing-selectors-with-props-across-multiple-components.
But before rewriting tons of code, I'd like to see which selectors are recomputed the most.
// note: I'm using redux-actions in here, so the actions might look a bit different than you are used too | |
// note: This is not complete but the concepts are | |
// excerpt from app.js | |
import { createStore, applyMiddleware } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import fetch from 'isomorphic-fetch' | |
// note: you could totally leave out the fetch argument here if you set a default (as I do in my actions) | |
// I'm right now not absolutely sure how I will handle this in the future (the way it is now it is a bit redundant) |
If you use atom... download & install the following packages:
# Windows | |
Build MyProjectEditor Win64 Development "D:\Unreal\MyProject\MyProject.uproject" -waitmutex | |
# Linux | |
Build.sh MyProjectEditor Linux Development "/home/mvlabat/unreal/projects/MyProject/MyProject.uproject" -waitmutex |
#!/bin/bash | |
# Save this file as /usr/bin/apt-pac and chmod +x it. | |
case "$1" in | |
autoremove) | |
pacman -Rns $(pacman -Qdtq); | |
;; |
#include <mapbox/variant.hpp> | |
#include <redux.hpp> | |
struct Increment | |
{ | |
}; | |
struct Decrement | |
{ | |
}; |
Together with HellMood we won this year's (2016) JS1K competition and thought this might be a good opportunity to write about the development process and my motivation behind it. If you're already familiar with JS1K, feel free to skip the next two paragraphs.
import { matchPath } from 'react-router'; | |
class MainRouter extends Component { | |
static displayName = 'MainRouter'; | |
static propTypes = { | |
store: React.PropTypes.object, | |
component: React.PropTypes.oneOfType([ | |
React.PropTypes.element, | |
React.PropTypes.func, | |
]) |