UNPKG

554 BJavaScriptView Raw
1"use strict";
2var DagGraph_1 = require("../DagGraph");
3var jumpToState_1 = require("./jumpToState");
4var log = require('debug')('redux-dag-history:DagHistory');
5function skipToStart(history) {
6 var graph = history.graph;
7 var reader = new DagGraph_1.default(graph);
8 var result = reader.currentStateId;
9 while (reader.parentOf(result) !== null) {
10 result = reader.parentOf(result);
11 }
12 return jumpToState_1.default(result, history);
13}
14Object.defineProperty(exports, "__esModule", { value: true });
15exports.default = skipToStart;