PureMVC Framework for Haxe: API Documentation
Back | Index
class org.puremvc.haxe.patterns.observer.Observer
implements org.puremvc.haxe.interfaces.IObserver

A base `IObserver` implementation.

An `Observer` is an object that encapsulates information about an interested object with a method that should be called when a particular `INotification` is broadcast.

In PureMVC, the `Observer` class assumes these responsibilities:

- Encapsulate the notification (callback) method of the interested object.
- Encapsulate the notification context (this) of the interested object.
- Provide methods for setting the notification method and context.
- Provide a method for notifying the interested object.

function new(notifyMethod : Dynamic -> Void, notifyContext : Dynamic) : Void

  Constructor.

  The notification method on the interested object should take one parameter of type `INotification`

function compareNotifyContext(object : Dynamic) : Bool
function notifyObserver(notification : org.puremvc.haxe.interfaces.INotification) : Void
function setNotifyContext(notifyContext : Dynamic) : Void
function setNotifyMethod(notifyMethod : Dynamic -> Void) : Void

Back | Index