* Pulls value from the store. Same as calling store.get then store.unset. * * @param key - The key or key path to pull * @param defaultValue - Default value if key doesn't exist * * @example * const message = store.pull('notification', 'No messages') * const data = store.pull(['
(key: string | string[], defaultValue?: any)
| 194 | * const data = store.pull(['temp', 'data']) |
| 195 | */ |
| 196 | pull(key: string | string[], defaultValue?: any): any { |
| 197 | return ((value): any => { |
| 198 | this.unset(key) |
| 199 | return value |
| 200 | })(this.get(key, defaultValue)) |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Increments a numeric value. Raises an error when underlying value is not a number. |