Commit 04cc635 1 parent 4084e2b commit 04cc635 Copy full SHA for 04cc635
File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.0.11
2
+
3
+ * Setting up the plugin now just requires that you create an
4
+ ` automergeSyncPlugin ` and pass it the ` handle ` and ` path ` . I.e. you go from
5
+ this:
6
+
7
+ ``` typescript
8
+ const doc = handle .docSync ()
9
+ const source = doc .text // this should use path
10
+ const plugin = amgPlugin (doc , path )
11
+ const semaphore = new PatchSemaphore (plugin )
12
+ const view = (editorRoot .current = new EditorView ({
13
+ doc: source ,
14
+ extensions: [basicSetup , plugin ],
15
+ dispatch(transaction ) {
16
+ view .update ([transaction ])
17
+ semaphore .reconcile (handle , view )
18
+ },
19
+ parent: containerRef .current ,
20
+ }))
21
+
22
+ const handleChange = ({ doc , patchInfo }) => {
23
+ semaphore .reconcile (handle , view )
24
+ }
25
+ ```
26
+
27
+ To this
28
+
29
+ ``` typescript
30
+ const view = new EditorView ({
31
+ doc: handle .docSync ()! .text ,
32
+ extensions: [
33
+ basicSetup ,
34
+ automergeSyncPlugin ({
35
+ handle ,
36
+ path: [" text" ],
37
+ }),
38
+ ],
39
+ parent: container ,
40
+ })
41
+ ```
42
+
You can’t perform that action at this time.
0 commit comments