rjz / typescript-react-redux

A TypeScript-enabled react/redux application
https://rjzaworski.com/c/typescript
Other
124 stars 24 forks source link

Drop unnecessary namespaces #19

Closed rjz closed 7 years ago

rjz commented 7 years ago

E.g. in src/reducers/Store, the Store namespace can be flattened out:

export type Counter = {
  value: number,
}

export type All = {
  counter: Counter,
  isSaving: boolean,
  isLoading: boolean,
  error: string,
}

...and its effect still captured nicely via import:

import * as store from './src/reducers/store'

const state: store.All = // ...

HT @egmanoj for the suggestion!