Skip to content

rkrupinski/cyclejs-animated-localstorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cycle animated localStorage driver

A Cycle.js driver for animating (srsly) localStorage.

npm install --save cyclejs-animated-localstorage

shrug

Usage

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: '☺'.

About

A Cycle.js driver for animating (srsly) localStorage.

Resources

Stars

Watchers

Forks

Packages

No packages published