Skip to content

Commit 80328a3

Browse files
authored
Merge pull request #184 from davidroeca/more_exports
export newHistory function
2 parents e4bf3ac + 6cac72c commit 80328a3

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/helpers.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ export function groupByActionTypes (rawActions) {
5454
const actions = parseActions(rawActions)
5555
return (action) => actions.indexOf(action.type) >= 0 ? action.type : null
5656
}
57+
58+
export function newHistory (past, present, future, group = null) {
59+
return {
60+
past,
61+
present,
62+
future,
63+
group,
64+
_latestUnfiltered: present,
65+
index: past.length,
66+
limit: past.length + future.length + 1
67+
}
68+
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export { ActionTypes, ActionCreators } from './actions'
22
export {
33
parseActions, isHistory,
44
distinctState, includeAction, excludeAction,
5-
combineFilters, groupByActionTypes
5+
combineFilters, groupByActionTypes, newHistory
66
} from './helpers'
77

88
export { default } from './reducer'

src/reducer.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
import * as debug from './debug'
22
import { ActionTypes } from './actions'
3-
import { parseActions, isHistory } from './helpers'
4-
5-
function newHistory (past, present, future, group = null) {
6-
return {
7-
past,
8-
present,
9-
future,
10-
group,
11-
_latestUnfiltered: present,
12-
index: past.length,
13-
limit: past.length + future.length + 1
14-
}
15-
}
3+
import { parseActions, isHistory, newHistory } from './helpers'
164

175
// createHistory
186
function createHistory (state, ignoreInitialState) {

0 commit comments

Comments
 (0)