# WebLocalStorage

Artifact: [androidx.datastore:datastore-core-okio](https://developer.android.com/jetpack/androidx/releases/datastore) [View Source](https://cs.android.com/search?q=file:androidx/datastore/core/okio/WebStorage.web.kt+class:androidx.datastore.core.okio.WebLocalStorage) Common/AllJavaScript
- JS

  ```
  class WebLocalStorage<T : Any?> : Storage<T>
  ```

*** ** * ** ***

## Summary

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/datastore/core/okio/WebLocalStorage#WebLocalStorage(androidx.datastore.core.okio.OkioSerializer,kotlin.String)(serializer: https://developer.android.com/reference/kotlin/androidx/datastore/core/okio/OkioSerializer<T>, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` | JS |

| ### Public functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/datastore/core/StorageConnection<T>` | `https://developer.android.com/reference/kotlin/androidx/datastore/core/okio/WebLocalStorage#createConnection()()` Creates a storage connection which allows reading and writing to the underlying storage. | JS |

## Public constructors

### WebLocalStorage

JS

```
<T : Any?> WebLocalStorage(serializer: OkioSerializer<T>, name: String)
```

## Public functions

### createConnection

JS

```
open fun createConnection(): StorageConnection<T>
```

Creates a storage connection which allows reading and writing to the underlying storage.

Should be closed after usage.

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/datastore/core/IOException` | Unrecoverable IO exception when trying to access the underlying storage. |