Client-only code is currently handled by @clientInit meta data attached to a method. This is okay, but it leads to extra code required to invoke the function upon construction of the object on the client. IE
class MyObject {
public function new () {
//Generic setup
#if js
clientCode();
#end
}
@clientInit
public function clientCode ():Void {
//Do something only on the client
}
}
This should be switched to a macro that not only invokes the method upon load, but also if the constructor is called on the client.
Client-only code is currently handled by @clientInit meta data attached to a method. This is okay, but it leads to extra code required to invoke the function upon construction of the object on the client. IE
This should be switched to a macro that not only invokes the method upon load, but also if the constructor is called on the client.