0.2.0 • Published 7 years ago

slate-auto-save v0.2.0

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

slate-auto-save

A Slate plugin to handle onChange event on silence without event stack. Useful for implementing auto save Editor.

Installation

npm install slate-auto-save

Usage

import autoSavePlugin, { delay } from 'slate-auto-save';

const doSomeThing = (state) => {
  console.log(state);
}
const autoSaveDelay = delay(3000); //milliseconds
const plugins = [
  autoSavePlugin(doSomeThing, autoSaveDelay)
  // can use autoSavePlugin(doSomeThing) if you want delay 2000ms by default
];

// And later pass it into the Slate editor...
<Editor
  ...
  plugins={plugins}
/>

Contributions

Pull requests are welcome.

License

MIT © komcal

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago