Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthewmueller/remember
Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.
https://github.com/matthewmueller/remember
Last synced: about 1 month ago
JSON representation
Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.
- Host: GitHub
- URL: https://github.com/matthewmueller/remember
- Owner: matthewmueller
- Created: 2013-03-22T03:30:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-06T03:14:42.000Z (almost 10 years ago)
- Last Synced: 2024-04-08T20:10:11.293Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 157 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# remember
Use localstorage to remember input values. Supports textareas and inputs including radio buttons and checkboxes.
## Example
```js
var remember = require('remember');remember()
.except('input[type=password]');
```## Installation
$ component install matthewmueller/remember
## Design
This library uses document-level event delegation to capture input. This allows for efficient and "live" bindings. The caveat to this approach is that if you use `e.stopPropagation()` within another input binding, remember's bindings will not trigger and the input will not be saved.
## API
### `Remember([options])`
Initializes remember and pulls in the previously stored values. Options include:
* `namespace`: used to namespace the values in localstorage. Defaults to `remember:`.
### `.except(selector)`
Excludes elements that match the selector.
### `.clear()`
Clears localstorage
### `.unbind()`
Unbinds all textareas and inputs.
## Special Thanks
[Garlic.js](http://garlicjs.org/) was the source of inspiration for this project and a good reference.
## License
MIT