Shortcuts adds convenience identifiers to access ceramic app, screen, ...
Use it by adding import ceramic.Shortcuts.*;
in your files.
Static variables
Static methods
staticinlineunobserve():Void
Ensures current autorun
won't be affected by the code after this call.
reobserve()
should be called to restore previous state.
staticinlinereobserve():Void
Resume observing values and resume affecting current autorun
scope.
This should be called after an unobserve()
call.
staticinlinecease():Void
Unbinds and destroys current autorun
. The name cease()
has been chosed there
so that it is unlikely to collide with other more common names suchs as stop
, unbind
etc...
and should make it more recognizable, along with observe()
and unobserve()
.
staticuntil(exprs:Dynamic):Autorun
Wait until the observable condition becomes true to execute the callback once (and only once). Creates an Autorun
instance and returns it.
Usage:
// Resulting autorun attached to "this" if available and a valid entity
until(something == true, callback);
// Add "null" if you don't want it to be attached to anything
until(null, something == true, callback);
// Attach to another entity
until(entity, something == true, callback);