Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkrupinski/cyclejs-animated-localstorage
A Cycle.js driver for animating (srsly) localStorage.
https://github.com/rkrupinski/cyclejs-animated-localstorage
Last synced: about 1 month ago
JSON representation
A Cycle.js driver for animating (srsly) localStorage.
- Host: GitHub
- URL: https://github.com/rkrupinski/cyclejs-animated-localstorage
- Owner: rkrupinski
- Created: 2016-06-15T16:57:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-21T07:11:51.000Z (over 8 years ago)
- Last Synced: 2024-10-03T17:08:13.782Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 756 KB
- Stars: 17
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cycle animated localStorage driver
A [Cycle.js](http://cycle.js.org) [driver](http://cycle.js.org/drivers.html) for animating (srsly) [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).
```
npm install --save cyclejs-animated-localstorage
```![shrug](assets/shrug.gif)
## Usage
```js
import { Observable } from 'rx';
import { run } from '@cycle/core';
import makeAnimatedLocalStorageDriver from 'cyclejs-animated-localstorage';function main() {
const text$ = Observable.just('¯\\_(ツ)_/¯');return {
animatedText: text$,
};
}const drivers = {
animatedText: makeAnimatedLocalStorageDriver(),
};run(main, drivers);
```## Configuration
The `makeAnimatedLocalStorageDriver` function takes one parameter - the `options` object.
Available options include:
- `interval` (Number): how often (ms) should the value be updated. Default: `100`.
- `size` (Number): the width (in characters) of the text. Default: `20`.
- `placeholder` (String): the character to fill blank space with. Default: `'_'`.
- `key` (String): the localStorage key. Default: `'☺'`.