Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function originCommit (action, isNotObjectTypeAction) {
if (action.type === 'logux/state') {
self.replaceState(action.state)
return
}
var commitArgs = arguments
if (isNotObjectTypeAction) {
commitArgs = [action.type].concat(action.options)
}
if (action.type in self._mutations) {
Store.prototype.commit.apply(self, commitArgs)
}
}
if (meta.added) saveHistory(meta)
} else {
replay(meta.id, replayIsSafe).then(function () {
if (meta.reasons.indexOf('replay') !== -1) {
client.log.changeMeta(meta.id, {
reasons: meta.reasons.filter(function (i) {
return i !== 'replay'
})
})
}
})
}
}
}
LoguxState.prototype = Object.create(Store.prototype)
LoguxState.prototype.constructor = LoguxState
function createLoguxState (config) {
if (!config) config = {}
var client = new CrossTabClient(config)
return LoguxState.bind(null, client, {
dispatchHistory: config.dispatchHistory || 1000,
saveStateEvery: config.saveStateEvery || 50,
onMissedHistory: config.onMissedHistory
})
}
module.exports = createLoguxState