pubsub.TypedPubSub Extends goog.Disposable
This object is a temporary shim that provides goog.pubsub.TopicId support for goog.pubsub.PubSub. See b/12477087 for more info.

Inheritance

Constructor

goog.pubsub.TypedPubSub()

Instance Methods

Public Protected Private
clear(opt_topic)
See goog.pubsub.PubSub.clear.
Arguments:
opt_topic : !goog.pubsub.TopicId.<PAYLOAD>>
Topic to clear (all topics if unspecified).
code »
getCount(opt_topic) number
See goog.pubsub.PubSub.getCount.
Arguments:
opt_topic : !goog.pubsub.TopicId.<PAYLOAD>>
The topic (all topics if unspecified).
Returns: number  Number of subscriptions to the topic.
code »
publish(topicpayload) boolean
See goog.pubsub.PubSub.publish.
Arguments:
topic : !goog.pubsub.TopicId.<PAYLOAD>
Topic to publish to.
payload : PAYLOAD
Payload passed to each subscription function.
Returns: boolean  Whether any subscriptions were called.
code »
subscribe(topicfnopt_context) number
See goog.pubsub.PubSub.subscribe.
Arguments:
topic : !goog.pubsub.TopicId.<PAYLOAD>
Topic to subscribe to.
fn : function(this:CONTEXT, PAYLOAD)
Function to be invoked when a message is published to the given topic.
opt_context : CONTEXT=
Object in whose context the function is to be called (the global scope if none).
Returns: number  Subscription key.
code »
subscribeOnce(topicfnopt_context) number
See goog.pubsub.PubSub.subscribeOnce.
Arguments:
topic : !goog.pubsub.TopicId.<PAYLOAD>
Topic to subscribe to.
fn : function(this:CONTEXT, PAYLOAD)
Function to be invoked once and then unsubscribed when a message is published to the given topic.
opt_context : CONTEXT=
Object in whose context the function is to be called (the global scope if none).
Returns: number  Subscription key.
code »
unsubscribe(topicfnopt_context) boolean
See goog.pubsub.PubSub.unsubscribe.
Arguments:
topic : !goog.pubsub.TopicId.<PAYLOAD>
Topic to unsubscribe from.
fn : function(this:CONTEXT, PAYLOAD)
Function to unsubscribe.
opt_context : CONTEXT=
Object in whose context the function was to be called (the global scope if none).
Returns: boolean  Whether a matching subscription was removed.
code »
unsubscribeByKey(key) boolean
See goog.pubsub.PubSub.unsubscribeByKey.
Arguments:
key : number
Subscription key.
Returns: boolean  Whether a matching subscription was removed.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
  mypackage.MyClass = function() {
    mypackage.MyClass.base(this, 'constructor');
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    mypackage.MyClass.base(this, 'disposeInternal');
  };
code »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

constructor :
No description.
Code »
pubSub_ : goog.pubsub.PubSub
No description.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Properties

goog.pubsub.TypedPubSub.superClass_ :
No description.
Code »

Package pubsub

Package Reference