Skip to content

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

License

Notifications You must be signed in to change notification settings

komkanit/slate-auto-save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors