Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated auth sagas, store, rootreducer with types #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/client/reducers/rootReducer.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { combineReducers, Dispatch, Reducer, Action, AnyAction } from 'redux';
import authReducer from './authReducer';
import { authReducer } from './authReducer';
import { AuthStateProps } from '../Components/SignUp/SignUp';
// import { Store } from '../store/store';

export interface ApplicationState {
auth: authReducer
}
export type Store = {
authReducer: AuthStateProps
}

const rootReducer = combineReducers<ApplicationState>({
auth: authReducer,
const rootReducer = combineReducers<Store>({
authReducer
});

export default rootReducer;
Expand Down
4 changes: 2 additions & 2 deletions src/client/sagas/authSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function* handleSignUp(userData) {
}
}

function* signupWatcher () {
function* signupUser () {
yield takeLatest(types.SIGNUP_REQUEST, handleSignUp)
}

export default signupWatcher;
export default signupUser;
4 changes: 2 additions & 2 deletions src/client/sagas/combinedSagas.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { all, fork } from 'redux-saga/effects';
import signupWatcher from './authSagas';
import signupUser from './authSagas';

export default function* CombinedSagas() {
yield all([
fork(signupWatcher),
fork(signupUser),
]);
}
6 changes: 0 additions & 6 deletions src/client/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import rootReducer from '../reducers/rootReducer';
import CombinedSagas from '../sagas/combinedSagas';
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import { AuthStateProps } from '../Components/SignUp/SignUp';
import authReducer from '../reducers/authReducer';

export type Store = {
authReducer: AuthStateProps
}

// Setup the middleware to watch between the Reducers and the Actions
const sagaMiddleware = createSagaMiddleware();
Expand Down