From ee3989720b28edbe56a84c4d00c6706652342941 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 31 Jul 2015 11:59:56 -0600 Subject: [PATCH] Fix ViewRegistry::addViewProvider documentation --- src/view-registry.coffee | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/view-registry.coffee b/src/view-registry.coffee index 58b2bf7c0..ca9b7cdb7 100644 --- a/src/view-registry.coffee +++ b/src/view-registry.coffee @@ -70,24 +70,15 @@ class ViewRegistry # workspace what view constructor it should use to represent them: # # ```coffee - # atom.views.addViewProvider - # modelConstructor: TextEditor - # viewConstructor: TextEditorElement + # atom.views.addViewProvider TextEditor, (textEditor) -> + # textEditorElement = new TextEditorElement + # textEditorElement.initialize(textEditor) + # textEditorElement # ``` # - # * `providerSpec` {Object} containing the following keys: - # * `modelConstructor` Constructor {Function} for your model. - # * `viewConstructor` (Optional) Constructor {Function} for your view. It - # should be a subclass of `HTMLElement` (that is, your view should be a - # DOM node) and have a `::setModel()` method which will be called - # immediately after construction. If you don't supply this property, you - # must supply the `createView` property with a function that never returns - # `undefined`. - # * `createView` (Optional) Factory {Function} that must return a subclass - # of `HTMLElement` or `undefined`. If this property is not present or the - # function returns `undefined`, the view provider will fall back to the - # `viewConstructor` property. If you don't provide this property, you must - # provider a `viewConstructor` property. + # * `modelConstructor` Constructor {Function} for your model. + # * `createView` Factory {Function} that is passed an instance of your model + # and must return a subclass of `HTMLElement` or `undefined`. # # Returns a {Disposable} on which `.dispose()` can be called to remove the # added provider.