aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/event_target_polyfill.js9
-rw-r--r--src/lib/persisted_state.js5
2 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/event_target_polyfill.js b/src/lib/event_target_polyfill.js
new file mode 100644
index 00000000..2042c770
--- /dev/null
+++ b/src/lib/event_target_polyfill.js
@@ -0,0 +1,9 @@
+import EventTargetPolyfill from '@ungap/event-target'
+
+try {
+ /* eslint-disable no-new */
+ new EventTarget()
+ /* eslint-enable no-new */
+} catch (e) {
+ window.EventTarget = EventTargetPolyfill
+}
diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js
index cad7ea25..8ecb66a8 100644
--- a/src/lib/persisted_state.js
+++ b/src/lib/persisted_state.js
@@ -1,13 +1,12 @@
import merge from 'lodash.merge'
-import objectPath from 'object-path'
import localforage from 'localforage'
-import { each } from 'lodash'
+import { each, get, set } from 'lodash'
let loaded = false
const defaultReducer = (state, paths) => (
paths.length === 0 ? state : paths.reduce((substate, path) => {
- objectPath.set(substate, path, objectPath.get(state, path))
+ set(substate, path, get(state, path))
return substate
}, {})
)