From 47496eedd4eff258c007bcfb8857df56b38083be Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 11 Jan 2021 20:05:00 -0800 Subject: [PATCH] topics [nfc]: Cut a few redundant type annotations. Flow infers these just fine. They don't add much for the reader, as the selectors that feed these parameters are right there in the lines above and are generally pretty clear. (The reader might be surprised to learn that `getMute` returns a list of pairs... but this annotation, as `MuteState`, wasn't helping with that anyway.) And by repeating the expected types for these selectors to return, they add friction for changing them. So take them out. (A lot of our other createSelector calls could usefully get the same treatment.) --- src/topics/topicSelectors.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/topics/topicSelectors.js b/src/topics/topicSelectors.js index 8f79cbb29e2..f25b482b22c 100644 --- a/src/topics/topicSelectors.js +++ b/src/topics/topicSelectors.js @@ -2,14 +2,10 @@ import { createSelector } from 'reselect'; import type { - MuteState, Narrow, GlobalState, Selector, - Stream, StreamsState, - StreamUnreadItem, - Topic, TopicExtended, TopicsState, } from '../types'; @@ -49,12 +45,7 @@ export const getTopicsForStream: Selector = createSe state => getMute(state), (state, streamId) => getStreamsById(state).get(streamId), state => getUnreadStreams(state), - ( - topicList: Topic[], - mute: MuteState, - stream: Stream | void, - unreadStreams: StreamUnreadItem[], - ) => { + (topicList, mute, stream, unreadStreams) => { if (!topicList || !stream) { return undefined; }