DefineSignals

abstract
class DefineSignals : Element(
Element
names...
) if (
is(Element : HTMLElement) &&
names.length >= 1
) {}

Constructors

this
this(T args)
Undocumented in source.

Examples

class MyButton : DefineSignals!(DeclareSignals!(HTMLElement, "onClick"), "onClick")
{
    this(string id)
    {
        super(id, true);
    }

    string html() const { ... }
}


MyButton btn1 = new MyButton("btn1");
btn1.onClick.strongConnect(delegate(FiredContext ctx, WeakRef!(const(JSArrayCpp)) arr){
    assert(ctx.sender == btn1);

    writeln("fired a signal by ", ctx);
});

Meta