store icon indicating copy to clipboard operation
store copied to clipboard

Use annotation to generate combiners

Open rightisleft opened this issue 8 years ago • 2 comments

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) {
...
}

rightisleft avatar Jun 20 '17 17:06 rightisleft

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.

e-schultz avatar Jul 11 '17 19:07 e-schultz

@rightisleft can you provide a clearer use case/example of how this could work? still not clear

e-schultz avatar Nov 08 '17 17:11 e-schultz