Merge pull request #211 from relm-us/doc-get-docs
Small improvements to Y.Doc().get(..) documentation
This commit is contained in:
		
						commit
						e07b0f4100
					
				| @ -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 |    * Multiple calls of `y.get(name, TypeConstructor)` yield the same result | ||||||
|    * and do not overwrite each other. I.e. |    * and do not overwrite each other, i.e. | ||||||
|    * `y.define(name, Y.Array) === y.define(name, Y.Array)` |    *   `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)`. |    * After this method is called, the type is also available on `y.share.get(name)`. | ||||||
|    * |    * | ||||||
|    * *Best Practices:* |    * *Best Practices:* | ||||||
|    * Define all types right after the Yjs instance is created and store them in a separate object. |    * 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 |    * @example | ||||||
|    *   const y = new Y(..) |    *   const y = new Y(..) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user