From 78c947273e7576d1a02121eb201e15df674a03bc Mon Sep 17 00:00:00 2001 From: Duane Johnson Date: Tue, 9 Jun 2020 18:46:14 -0600 Subject: [PATCH] Small improvements to Y.Doc().get(..) documentation --- src/utils/Doc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/Doc.js b/src/utils/Doc.js index 4eab58f7..b20eb36d 100644 --- a/src/utils/Doc.js +++ b/src/utils/Doc.js @@ -65,17 +65,17 @@ export class Doc extends Observable { } /** - * Define a shared data type. + * Get a shared data type by name. If it does not yet exist, define its type. * * Multiple calls of `y.get(name, TypeConstructor)` yield the same result - * and do not overwrite each other. I.e. - * `y.define(name, Y.Array) === y.define(name, Y.Array)` + * and do not overwrite each other, i.e. + * `y.get(name, Y.Array) === y.get(name, Y.Array)` * * After this method is called, the type is also available on `y.share.get(name)`. * * *Best Practices:* * Define all types right after the Yjs instance is created and store them in a separate object. - * Also use the typed methods `getText(name)`, `getArray(name)`, .. + * Also use the typed methods `getText(name)`, `getArray(name)`, `getMap(name)`, etc. * * @example * const y = new Y(..)