aboutsummaryrefslogtreecommitdiff
path: root/src/store/rootReducer.ts
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-04 08:50:24 -0800
committerGitHub <noreply@github.com>2020-12-04 11:50:24 -0500
commit0fd892ad288f2e1eaaa4fdf5e1fd6f15dbd45860 (patch)
treed7d53d94c6c4026ac9b325508ebce4706d412ac4 /src/store/rootReducer.ts
parentf620102190629e0b6f180d3ce056d850b1db5aaa (diff)
[TMA - 398 AND TMA-430] Replace Providers with Redux Store (#125)
* First * WIP * Thunk * Some more comments * sc * recent searches and follounfollow * Edit profile dummy * Block / unblock and some cleanup * Replace auth provider * Sc * Delete AP after rebase * Discover users * Cleanup * More cleanup * Replace profile provider * Fixed build failure * Fixed a bug reported * Prevent app crash when backend server is down
Diffstat (limited to 'src/store/rootReducer.ts')
-rw-r--r--src/store/rootReducer.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/store/rootReducer.ts b/src/store/rootReducer.ts
new file mode 100644
index 00000000..695ed8c7
--- /dev/null
+++ b/src/store/rootReducer.ts
@@ -0,0 +1,30 @@
+import {combineReducers} from 'redux';
+import {
+ userDataReducer,
+ userSocialsReducer,
+ userFollowReducer,
+ userMomentsReducer,
+ taggUsersReducer,
+ userBlockReducer,
+ userXReducer,
+} from './reducers';
+
+/**
+ * Combine all the reducers in our application.
+ */
+
+const rootReducer = combineReducers({
+ user: userDataReducer,
+ follow: userFollowReducer,
+ moments: userMomentsReducer,
+ socialAccounts: userSocialsReducer,
+ taggUsers: taggUsersReducer,
+ blocked: userBlockReducer,
+ userX: userXReducer,
+});
+
+/**
+ * This RootState export is needed when a component subscribes to a slice of the state.
+ */
+export type RootState = ReturnType<typeof rootReducer>;
+export default rootReducer;