TIL, 2018-05-15, Hacking around with Redux
JS/Redux
- 1 store per app. Put
createStore
inindex.js
. - You can do an
import rootReducer
. -
Seriously a lot of hacking on getting Redux to work with React.
- On the Redux store:
- In general, you want to only make top-level container components ones that have access to the store.
- Smart components = know about the Redux store/state, dumb components just get passed to them and have no idea about the bigger application state.
- Provider component: you wrap your whole app with it.
action_creators
:
import createStore from '../store';
const store = createStore()
class App extends Component {
render() {
return (
<Provider store={store}>
<MainAppContainer />
</Provider>
)
}
}
Ruby
Removing strong parameters if using dry-validation anyway.
- We already have
HashWithIndifferentAccess
anyways already, might as well use it instead of the regular hash.