open class Observable
An object that emits events. Listeners can bind to specific events and be notified when the event is triggered.
Observable()
An object that emits events. Listeners can bind to specific events and be notified when the event is triggered. |
val callbacks: MutableMap<String, MutableList<ObservableCallback>>
A dictionary that contains all methods to be executed when an event is triggered |
fun addCallback(event: String, callback: ObservableCallback): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a parameter and return a Deferred that will be completed asynchronously. |
|
fun bind(event: String, callback: (args: Map<String, Any>) -> Unit): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a
parameter. The block will be executed synchronously, for costly operations prefer
the use of |
|
fun bindAsync(event: String, callback: ObservableCallback): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a parameter and return a Deferred that will be completed asynchronously. |
|
fun bindSync(event: String, callback: (args: Map<String, Any>) -> Unit): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a
parameter. The block will be executed synchronously, for costly operations prefer
the use of |
|
fun removeCallback(event: String, callback: ObservableCallback?): Unit
Unbinds the provided callback from an event. |
|
fun runCallbacks(event: String, args: Map<String, Any> = HashMap()): Deferred<List<Any?>>
Triggers the event by calling all its bound callbacks with args as parameters. |
|
fun trigger(event: String, args: Map<String, Any> = HashMap()): Deferred<List<Any?>>
Triggers the event by calling all its bound callbacks with args as parameters. |
|
fun unbind(event: String, callback: ObservableCallback?): Unit
Unbinds the provided callback from an event. |
open class Interactable : Observable
An entity that reactively represents a Ripe instance. |
|
open class Plugin : Observable
Base class of a Ripe Plugin. |
|
class Ripe : Observable
Represents a customizable model. The options map supports the following keys: |