Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JSON CRDT "str" node binding to any generic plain text editor UI.

NotificationsYou must be signed in to change notification settings

streamich/collaborative-editor

Repository files navigation

This package provides binding for a generic text editor to aJSON CRDTstr node.

collaborative-editor

Usage

Installation:

npm install json-joy collaborative-editor

Simple 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();

Preview

About

JSON CRDT "str" node binding to any generic plain text editor UI.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp