Skip to content
soliton4 edited this page Dec 9, 2014 · 2 revisions

#connect

Stability: 3 - Stable

required

  • [type safety](type safety)

a Qt inspired event system.
simply connect member functions together.

class type Emitter {
  event: (param){}
};

class type Reciever {
  eventSlot: (param){
    // gets the same parameter
  }
};

Emitter e = new Emitter();
Reciever r = new Reciever();

var cutConnection = connect e.event r.eventSlot;

e.event("param"); // causes both member functions to execute
r.eventSlot(); // only calls eventSlot

syntax: connect object1.emittingMember object2.recievingMember

the return value is a function that cuts the connection when called.

  cutConnection();
  e.event("param"); // calls only event

####achievement have a convenient event system at your disposal.

continue reading about type modifiers

Clone this wiki locally