-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add flow for loading auth token add token to api auth header on app startup add AppStateRedux to track hydration state simplify ejs conditions
- Loading branch information
Showing
8 changed files
with
79 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { createReducer, createActions } from 'reduxsauce' | ||
import Immutable from 'seamless-immutable' | ||
|
||
/* ------------- Types and Action Creators ------------- */ | ||
|
||
const { Types, Creators } = createActions({ | ||
setRehydrationComplete: null | ||
}) | ||
|
||
export const AppStateTypes = Types | ||
export default Creators | ||
|
||
/* ------------- Initial State ------------- */ | ||
|
||
export const INITIAL_STATE = Immutable({ | ||
rehydrationComplete: false | ||
}) | ||
|
||
/* ------------- Reducers ------------- */ | ||
|
||
// rehydration is complete | ||
export const setRehydrationComplete = (state: Object) => | ||
state.merge({ rehydrationComplete: true }) | ||
|
||
/* ------------- Hookup Reducers To Types ------------- */ | ||
|
||
export const reducer = createReducer(INITIAL_STATE, { | ||
[Types.SET_REHYDRATION_COMPLETE]: setRehydrationComplete | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters