Skip to content

Commit

Permalink
Merge pull request #52 from seanpdoyle/document-options
Browse files Browse the repository at this point in the history
Add function option documentation to `README.md`
  • Loading branch information
theinterned authored Jan 23, 2024
2 parents e0984cd + c2538cf commit 9358f76
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ window.addEventListener('pagehide', function() {
})
```

#### `restoreResumableFields(id: string, options)`

The `restoreResumableFields(id: string, options)` function supports optional configurations:

* `storage:` - [`Storage`][] instance (defaults to [`window.sessionStorage`][])
* `keyPrefix:` - `string` prepended onto the storage key (defaults to `"session-resume"`)

[`Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
[`window.sessionStorage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

#### `persistResumableFields(id: string, options)`

The `persistResumableFields(id: string, options)` function supports optional configurations:

* `storage:` - [`Storage`][] instance (defaults to [`window.sessionStorage`][])
* `selector:` - `string` used to query field elements (defaults to `".js-session-resumable"`)
* `keyPrefix:` - `string` prepended onto the storage key (defaults to `"session-resume"`)

[`Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
[`window.sessionStorage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

## Development

```
Expand Down

0 comments on commit 9358f76

Please sign in to comment.