Redux
GitbookGatsby2021-01-05
π object expression
Itβs important to wrap it in parents, so that parser understands this as an expression
rather than a block.
Also, it can be nicer to use the concise method notation inside mapdispatchtoprops, instead of arrow functions because itβs harder.
const mapDispatchToProps = (dispatch) => ({
onTodoClick(id) {
dispatch({ type: "TOGGLE_TODO", id });
},
});
π Redux
- combineReducers
- applyMiddleware
- bindActionCreators
- compose
- Provider
- connect
- createStore
- Store
type Store = {
dispatch: Dispatch;
getState: () => State;
subscribe: (listener: () => void) => () => void;
replaceReducer: (reducer: Reducer) => void;
};
πͺ Store
- Nodes
gatsby-source-filesystem
- Schema
GraphQL schema inferred(ζ¨ζ) from Nodes
- Pages
Map
: path, component, context - Components:
Map
- Static Query Components:
Map