Skip to content

Commit

Permalink
Reintroduced @@redux-undo/INIT initType
Browse files Browse the repository at this point in the history
  • Loading branch information
teameh committed Mar 12, 2016
1 parent 7032876 commit c5bc86b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function undoable (reducer, rawConfig = {}) {
__DEBUG__ = rawConfig.debug

const config = {
initTypes: parseActions(rawConfig.initTypes, ['@@redux-undo/INIT']),
initTypes: parseActions(rawConfig.initTypes, ['@@redux-undo/INIT', '@@redux/INIT']),
limit: rawConfig.limit,
filter: rawConfig.filter || (() => true),
undoType: rawConfig.undoType || ActionTypes.UNDO,
Expand Down Expand Up @@ -292,8 +292,8 @@ export default function undoable (reducer, rawConfig = {}) {
}

// Don't add entry to history if it was just created
if ((justCreatedHistory && history.present === res) || action.type === '@@redux-undo/INIT') {
debug('not inserted, history was just created or action === redux-undo/INIT')
if (justCreatedHistory && history.present === res) {
debug('not inserted, history was just created')
} else {
history = insert(history, res, config.limit)
debug('inserted new state into history')
Expand Down

0 comments on commit c5bc86b

Please sign in to comment.