| 123 | * dispatch as a parameter, so it can report OOM to devtools |
| 124 | */ |
| 125 | setItem(key, value, dispatch) { |
| 126 | try { |
| 127 | this._setItem(key, value); |
| 128 | } catch (e) { |
| 129 | dispatch( |
| 130 | err( |
| 131 | `${key} failed to save in ${this._name}. Persisted props may be lost.` |
| 132 | ) |
| 133 | ); |
| 134 | // TODO: at some point we may want to convert this to fall back |
| 135 | // on memory, pulling out all persistence keys and putting them |
| 136 | // in a MemStore that gets used from then onward. |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | removeItem(key) { |
| 141 | this._storage.removeItem(storePrefix + key); |