Version 2.0.0
This release has a couple breaking changes:
falcor.loading
The loading
attribute is now set on the falcor state. This can be useful for deciding whether a value is missing of just hasn't been loaded by falcor yet.
function mapStateToProps(state) {
return {
loading: state.falcor.loading,
data: state.falcor.data,
};
}
If your falcor endpoint is already setting the loading
attribute this will have conflicts with you
Renamed action types
Before this release the name of the action type constants looked something like "FACLOR_SET_PATH"
. They have all been updated to follow redux standards and now look like "redux-falcor/falcor/SET_PATH"
.
If you were hard coding the name of the action types in your code, please use the next section when updating.
Exposed action type constants
All of the action type constants are now exposed by the library. That means it's much easier to write your own reducers on redux-falcor
actions.
import { RETRIEVE_VALUE } from 'redux-falcor';
function userReducer(state, action) {
if (action.type === RETRIEVE_VALUE && action.path == ['my', 'name']) {
return {...state, name: action.res};
}
return state;
}
If you were hard coding your reducers before, please use the new exposed constants