Skip to content

Almin: Make Payload abstract #276

@azu

Description

@azu

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions