diff --git a/src/state/ducks/auth/reducer.js b/src/state/ducks/auth/reducer.js index 19e6a65..2563b43 100644 --- a/src/state/ducks/auth/reducer.js +++ b/src/state/ducks/auth/reducer.js @@ -2,6 +2,13 @@ import { handleActions } from 'redux-actions'; import * as types from './types'; +/* auth reducer state shape: +{ + // true iff the user is authenticated + authenticated: boolean, +} +*/ + const defaultState = { authenticated: false, }; diff --git a/src/state/ducks/navigation/reducer.js b/src/state/ducks/navigation/reducer.js index e0b4c0b..6650464 100644 --- a/src/state/ducks/navigation/reducer.js +++ b/src/state/ducks/navigation/reducer.js @@ -5,6 +5,8 @@ import { RawNavigator } from '../../../navigation/AppNavigator'; const initialAction = RawNavigator.router.getActionForPathAndParams('Login'); const initialState = RawNavigator.router.getStateForAction(initialAction); +// state shape is defined by react-navigation + export default function reducer(state = initialState, action) { const nextState = RawNavigator.router.getStateForAction(action, state); return nextState || state; diff --git a/src/state/ducks/patreon/reducer.js b/src/state/ducks/patreon/reducer.js index d0368d5..15bc2ab 100644 --- a/src/state/ducks/patreon/reducer.js +++ b/src/state/ducks/patreon/reducer.js @@ -8,6 +8,19 @@ import { PATREON_ERROR, } from './types'; +/* patreon reducer state shape: +{ + // true iff the user has connected Patreon + enabled: boolean, + + // true iff we are waiting for a response from the Patreon API + loading: boolean, + + // if not null, the error from the last Patreon API call + error: ?Error, +} +*/ + const defaultState = { enabled: false, loading: false,