A simple example of event functionality in RaphaΓ«l :
Define the function that will trigger the event
function bar() { var a, b; a = 1; b = 2; eve("run-foo", "self", a, b); }
Event listener function
function foo(arg1, arg2, arg3) { // if the event is fired from bar() : // this == "self" // arg1 == a == 1 // arg2 == b == 2 // arg3 == undefined/null } eve.on("run-foo", foo);
source share