store
store copied to clipboard
Use annotation to generate combiners
This is a...
- [X] feature request
- [ ] bug report
- [ ] usage question
Expected Behaviour:
There should be type checking between IAppState and Reducers List
Actual Behaviour:
If i refactor a name in IAppState the declared properties in combineReducers are not guaranteed to be properly updated. This violates Type Safety goals.
Additional Notes:
It seems like we should be able to use TypeScript decorators to bind a reducer function to IAppState fields.
@BindReducer((state:IAppState) => state.foo)
public static reducer(oldState: IRemoteObject<VO> = initial, action: ActionPayload) {
...
}
Can you provide an example of how you are defining the interface in combineReducers? The way I've generally set this up - I haven't had much of an issue - as each key in combineReducers only gets handed in that slice of state - not the entire state.
@rightisleft can you provide a clearer use case/example of how this could work? still not clear