MCPcopy
hub / github.com/yjs/yjs / get

Method get

src/utils/Doc.js:204–210  ·  view source on GitHub ↗

* Define a shared data type. * * Multiple calls of `ydoc.get(name)` yield the same result * and do not overwrite each other. I.e. * `ydoc.get(name) === ydoc.get(name)` * * After this method is called, the type is also available on `ydoc.share.get(name)`. * * @param {string} k

(key = '', name = null)

Source from the content-addressed store, hash-verified

202 * @return {YType}
203 */
204 get (key = '', name = null) {
205 return map.setIfUndefined(this.share, key, () => {
206 const t = new YType(name)
207 t._integrate(this, null)
208 return t
209 })
210 }
211
212 /**
213 * Converts the entire document into a js object, recursively traversing each yjs type

Callers 15

testBasicUpdateFunction · 0.95
testSliceFunction · 0.95
testArrayFromFunction · 0.95
testLengthIssueFunction · 0.95
testLengthIssue2Function · 0.95
testAttributedContentFunction · 0.95
testArrayCompatibilityV1Function · 0.95
testBasicsFunction · 0.95

Calls 1

_integrateMethod · 0.95

Tested by

no test coverage detected