Merge branch 'faster-signup-1' into 'main'
[ProtonMail-WebClient.git] / packages / redux-shared-store / sharedListeners.ts
blob1c4bbae4a46c7bc54da54257a80a8e61d3c94dba
1 import type { TypedStartListening } from '@reduxjs/toolkit';
3 import {
4     type AddressKeysState,
5     type GroupMembershipsState,
6     type OrganizationKeyState,
7     type SecurityCheckupReduxState,
8     type UserInvitationsState,
9     type UserKeysState,
10     type UserSettingsState,
11     addressKeysListener,
12     authenticationListener,
13     groupMembershipsListener,
14     organizationKeysListener,
15     organizationThemeListener,
16     securityCheckupListener,
17     userInvitationsListener,
18     userKeysListener,
19 } from '@proton/account';
20 import type { ProtonDispatch, ProtonThunkArguments } from '@proton/redux-shared-store-types';
22 interface RequiredState
23     extends AddressKeysState,
24         UserKeysState,
25         UserSettingsState,
26         OrganizationKeyState,
27         UserInvitationsState,
28         SecurityCheckupReduxState,
29         GroupMembershipsState {}
31 type AppStartListening = TypedStartListening<RequiredState, ProtonDispatch<any>, ProtonThunkArguments>;
33 export const startSharedListening = (startListening: AppStartListening) => {
34     userKeysListener(startListening);
35     addressKeysListener(startListening);
36     organizationThemeListener(startListening);
37     organizationKeysListener(startListening);
38     userInvitationsListener(startListening);
39     authenticationListener(startListening);
40     securityCheckupListener(startListening);
41     groupMembershipsListener(startListening);