From 67dc703c185b3ea7edf93dedba5d496604bc834c Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 3 Sep 2014 16:46:53 -0600 Subject: [PATCH] :lipstick: docs --- src/pane.coffee | 7 +++++-- src/workspace.coffee | 16 ++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index ebc91caa0..d56ae007b 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -84,6 +84,8 @@ class Pane extends Model # Public: Invoke the given callback when the pane is destroyed. # # * `callback` {Function} to be called when the pane is destroyed. + # + # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. onDidDestroy: (callback) -> @emitter.on 'did-destroy', callback @@ -148,6 +150,8 @@ class Pane extends Model # Public: Invoke the given callback with all current and future items. # # * `callback` {Function} to be called with current and future items. + # * `item` An item that is present in {::getItems} at the time of + # subscription or that is added at some later time. # # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. observeItems: (callback) -> @@ -157,8 +161,7 @@ class Pane extends Model # Public: Invoke the given callback when the value of {::getActiveItem} # changes. # - # * `callback` {Function} to be called with when the active item - # changes. + # * `callback` {Function} to be called with when the active item changes. # * `activeItem` The current active item. # # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. diff --git a/src/workspace.coffee b/src/workspace.coffee index 664dbb28b..6f2003e8e 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -96,6 +96,8 @@ class Workspace extends Model # workspace. # # * `callback` {Function} to be called with current and future panes. + # * `pane` A {Pane} that is present in {::getPanes} at the time of + # subscription or that is added at some later time. # # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. observePanes: (callback) -> @paneContainer.observePanes(callback) @@ -116,6 +118,8 @@ class Workspace extends Model # the workspace. # # * `callback` {Function} to be called with current and future pane items. + # * `item` An item that is present in {::getPaneItems} at the time of + # subscription or that is added at some later time. # # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. observePaneItems: (callback) -> @paneContainer.observePaneItems(callback) @@ -139,28 +143,20 @@ class Workspace extends Model # editors in the workspace. # # * `callback` {Function} to be called with current and future text editors. + # * `editor` An {Editor} that is present in {::getTextEditors} at the time + # of subscription or that is added at some later time. # # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. observeTextEditors: (callback) -> callback(textEditor) for textEditor in @getTextEditors() @onDidAddTextEditor ({textEditor}) -> callback(textEditor) - # Deprecated: Register a function to be called for every current and future - # {Editor} in the workspace. - # - # * `callback` A {Function} with an {Editor} as its only argument. - # - # Returns a subscription object with an `.off` method that you can call to - # unregister the callback. eachEditor: (callback) -> deprecate("Use Workspace::observeTextEditors instead") callback(editor) for editor in @getEditors() @subscribe this, 'editor-created', (editor) -> callback(editor) - # Deprecated: Get all current editors in the workspace. - # - # Returns an {Array} of {Editor}s. getEditors: -> deprecate("Use Workspace::getTextEditors instead")