-
Notifications
You must be signed in to change notification settings - Fork 42
Almin: Make Payload abstract #276
Copy link
Copy link
Closed
Labels
Description
We will change Payload class to abstract class.
And it allow to use public field style.
class SubA extends Payload{
readonly type = "SubA"
}interface PayloadArgs{
type: any;
}
abstract class Payload {
readonly type: any;
constructor(args?: PayloadArgs) {
if (args) {
this.type = args.type;
}
}
}
/* public field */
class SubA extends Payload{
readonly type = "SubA"
}
/* super */
class SubB extends Payload{
constructor() {
super({type : "SubB"})
}
}
new SubA();
new SubB();Related
Reactions are currently unavailable