( updater: (current: PersistedUiState) => PersistedUiState, )
| 212 | } |
| 213 | |
| 214 | export function writePersistedUiState( |
| 215 | updater: (current: PersistedUiState) => PersistedUiState, |
| 216 | ): void { |
| 217 | if (typeof window === "undefined") { |
| 218 | return; |
| 219 | } |
| 220 | |
| 221 | const nextState = sanitizePersistedUiState(updater(readPersistedUiState())); |
| 222 | window.localStorage.setItem(UI_STATE_STORAGE_KEY, JSON.stringify(nextState)); |
| 223 | } |
| 224 | |
| 225 | export function viewportStateForUDID( |
| 226 | state: PersistedUiState, |
no test coverage detected