Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
streamich/collaborative-editor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This package provides binding for a generic text editor to aJSON CRDTstr node.
Installation:
npm install json-joy collaborative-editorSimple integration for any plain text editor, for the most basic integrationyou only need to implement the.get() and.set() methods:
import{StrBinding,EditorFacade}from'collaborative-editor';import{Model}from'json-joy/lib/json-crdt';conststr=model.api.str(['path','to','string']);constunbind=StrBinding.bind(str,{get:()=>input.value,set:(value:string)=>input.value=value,},true);
For a better integration, implement as manyEditorFacade methods as possible:
import{StrBinding,EditorFacade}from'collaborative-editor';consteditor:EditorFacade={// ...};conststr=model.api.str(['path','to','string']);constbinding=newStrBinding(str,editor);binding.syncFromModel();binding.bind(polling);// When done, unbind the binding.binding.unbind();
- Seedemo.
About
JSON CRDT "str" node binding to any generic plain text editor UI.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.
