diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-06-17 11:23:32 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-06-17 11:23:32 +0300 |
| commit | f8cf92a01f952f344ee4c3b7df153b2ffdb7988f (patch) | |
| tree | d1f20bc99722d2b94aeef772acd59083145d71ac /src/lib | |
| parent | 064b59812c715d60526727d42c124375a2bc89d5 (diff) | |
| parent | 57626c125d0477716a638854c4243ee0fde96923 (diff) | |
Merge branch 'develop' into kPherox/pleroma-fe-iss-149/profile-fields-display
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/event_target_polyfill.js | 9 | ||||
| -rw-r--r-- | src/lib/persisted_state.js | 5 |
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 }, {}) ) |
