UNPKG

@git-temporal/git-temporal-react

Version:

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

55 lines (54 loc) 1.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const ActionTypes_1 = require("app/actions/ActionTypes"); exports.diff = (state = null, action) => { switch (action.type) { case ActionTypes_1.ActionTypes.RECEIVE_DIFF: return action.diff; default: return state; } }; exports.isDiffDeferred = (state = false, action) => { switch (action.type) { case ActionTypes_1.ActionTypes.REQUEST_COMMITS: case ActionTypes_1.ActionTypes.REQUEST_DIFF: case ActionTypes_1.ActionTypes.RECEIVE_DIFF: return false; case ActionTypes_1.ActionTypes.REQUEST_DEFERRED_DIFF: return true; default: return state; } }; exports.isDiffFetching = (state = false, action) => { switch (action.type) { case ActionTypes_1.ActionTypes.REQUEST_COMMITS: case ActionTypes_1.ActionTypes.REQUEST_DIFF: return true; case ActionTypes_1.ActionTypes.RECEIVE_DIFF: return false; default: return state; } }; exports.diffLeftCommit = (state = null, action) => { switch (action.type) { case ActionTypes_1.ActionTypes.REQUEST_COMMITS: return null; case ActionTypes_1.ActionTypes.REQUEST_DIFF: return action.leftCommit || null; default: return state; } }; exports.diffRightCommit = (state = null, action) => { switch (action.type) { case ActionTypes_1.ActionTypes.REQUEST_COMMITS: return null; case ActionTypes_1.ActionTypes.REQUEST_DIFF: return action.rightCommit || null; default: return state; } };