Skip to content

Commit

Permalink
Use a simpler mechanism to make Flow happy for the selectors exports …
Browse files Browse the repository at this point in the history
…(PR #2003)
  • Loading branch information
julienw authored May 9, 2019
1 parent 5bbf187 commit 2dda732
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/selectors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,15 @@ import * as icons from './icons';
import * as publish from './publish';
import * as zippedProfiles from './zipped-profiles';

// Normally we don't need that type because flow can infer types, but on that
// object, it gives weird flow errors that say missing type annotation for X.
// Only adding a type like that seems to solve it.
type Selectors = {
app: typeof app,
profile: typeof profile,
urlState: typeof urlState,
icons: typeof icons,
publish: typeof publish,
zippedProfiles: typeof zippedProfiles,
selectedThread: typeof selectedThread,
};

export default ({
const allSelectors = {
app,
profile,
urlState,
icons,
publish,
zippedProfiles,
selectedThread,
}: Selectors);
};

// Flow requires that all exported object is explicitely typed.
export default (allSelectors: typeof allSelectors);

0 comments on commit 2dda732

Please sign in to comment.