Skip to content

Commit

Permalink
tech: add eslint ignore and a todo
Browse files Browse the repository at this point in the history
refs #2318
  • Loading branch information
shaman-apprentice committed Aug 4, 2021
1 parent 6586369 commit b9c977f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions visualization/app/codeCharta/state/angular-redux/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type ActionCreator = (...args: unknown[]) => Action
* By `mapStateToThis` returned `MappedState` is added to properties of returned class and reflects store's state automatically.
* By `mapDispatchToThis` returned `MappedDispatch` is added to properties of returned class but actual dispatches to store.
*/
/* eslint-disable-next-line @typescript-eslint/ban-types */ // we actual want to infer nothing if `MappedDispatch` is not given
export const connect = <MappedState extends Record<string, unknown>, MappedDispatch extends Record<string, ActionCreator> = {}>(
mapStateToThis?: (state: CcState, that?: This) => MappedState,
mapDispatchToThis?: MappedDispatch
Expand All @@ -31,6 +32,7 @@ export const connect = <MappedState extends Record<string, unknown>, MappedDispa

const setDispatchToThis = (that: This, keys: string[]) => {
for (const key of keys) {
// todo think about using Observerables
that[key] = (...args: unknown[]) => Store.store.dispatch(mapDispatchToThis[key](...args))
}
}
Expand Down

0 comments on commit b9c977f

Please sign in to comment.