Changeset View
Changeset View
Standalone View
Standalone View
web/redux/redux-setup.js
Show All 34 Lines | import { | ||||
updateWindowActiveActionType, | updateWindowActiveActionType, | ||||
setDeviceIDActionType, | setDeviceIDActionType, | ||||
updateNavInfoActionType, | updateNavInfoActionType, | ||||
updateWindowDimensionsActionType, | updateWindowDimensionsActionType, | ||||
updateCalendarCommunityFilter, | updateCalendarCommunityFilter, | ||||
clearCalendarCommunityFilter, | clearCalendarCommunityFilter, | ||||
} from './action-types.js'; | } from './action-types.js'; | ||||
import { reduceDeviceID } from './device-id-reducer.js'; | import { reduceDeviceID } from './device-id-reducer.js'; | ||||
import { reduceDeviceToken } from './device-token.reducer.js'; | |||||
import reduceNavInfo from './nav-reducer.js'; | import reduceNavInfo from './nav-reducer.js'; | ||||
import { | import { | ||||
reducePrimaryIdentityPublicKey, | reducePrimaryIdentityPublicKey, | ||||
setPrimaryIdentityPublicKey, | setPrimaryIdentityPublicKey, | ||||
} from './primary-identity-public-key-reducer.js'; | } from './primary-identity-public-key-reducer.js'; | ||||
import { getVisibility } from './visibility.js'; | import { getVisibility } from './visibility.js'; | ||||
import { filterThreadIDsBelongingToCommunity } from '../selectors/calendar-selectors.js'; | import { filterThreadIDsBelongingToCommunity } from '../selectors/calendar-selectors.js'; | ||||
import { activeThreadSelector } from '../selectors/nav-selectors.js'; | import { activeThreadSelector } from '../selectors/nav-selectors.js'; | ||||
Show All 13 Lines | export type AppState = { | ||||
messageStore: MessageStore, | messageStore: MessageStore, | ||||
updatesCurrentAsOf: number, | updatesCurrentAsOf: number, | ||||
loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } }, | loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } }, | ||||
calendarFilters: $ReadOnlyArray<CalendarFilter>, | calendarFilters: $ReadOnlyArray<CalendarFilter>, | ||||
calendarPickedCommunityID: ?string, | calendarPickedCommunityID: ?string, | ||||
urlPrefix: string, | urlPrefix: string, | ||||
windowDimensions: WindowDimensions, | windowDimensions: WindowDimensions, | ||||
cookie?: void, | cookie?: void, | ||||
deviceToken?: void, | deviceToken: ?string, | ||||
baseHref: string, | baseHref: string, | ||||
connection: ConnectionInfo, | connection: ConnectionInfo, | ||||
watchedThreadIDs: $ReadOnlyArray<string>, | watchedThreadIDs: $ReadOnlyArray<string>, | ||||
lifecycleState: LifecycleState, | lifecycleState: LifecycleState, | ||||
enabledApps: EnabledApps, | enabledApps: EnabledApps, | ||||
reportStore: ReportStore, | reportStore: ReportStore, | ||||
nextLocalID: number, | nextLocalID: number, | ||||
dataLoaded: boolean, | dataLoaded: boolean, | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | export function reducer(oldState: AppState | void, action: Action): AppState { | ||||
state = { | state = { | ||||
...state, | ...state, | ||||
navInfo: reduceNavInfo( | navInfo: reduceNavInfo( | ||||
state.navInfo, | state.navInfo, | ||||
action, | action, | ||||
state.threadStore.threadInfos, | state.threadStore.threadInfos, | ||||
), | ), | ||||
deviceID: reduceDeviceID(state.deviceID, action), | deviceID: reduceDeviceID(state.deviceID, action), | ||||
deviceToken: reduceDeviceToken(state.deviceToken, action), | |||||
ashoat: This could be in `baseReducer` I think | |||||
primaryIdentityPublicKey: reducePrimaryIdentityPublicKey( | primaryIdentityPublicKey: reducePrimaryIdentityPublicKey( | ||||
state.primaryIdentityPublicKey, | state.primaryIdentityPublicKey, | ||||
action, | action, | ||||
), | ), | ||||
}; | }; | ||||
return validateState(oldState, state); | return validateState(oldState, state); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |
This could be in baseReducer I think