summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/reducers/api.js
blob: 72f5f3387be27ada926ef8885fe595b6dfbb7275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const StateApi = require('../models/StateApi');
const ACTION_TYPES = require('../actions/TYPES');

module.exports = (state, action) => {
    state =  StateApi.create(state);

    switch (action.type) {
    case ACTION_TYPES.API_USER_FETCHED:
        return state.merge({
            currentUser: action.user
        });
    default:
        return state;
    }
};