Skip to content

Support static methods and object invariants? #195

@mlhaufe

Description

@mlhaufe
class Point2 {
  static create(x,y) {
    return new Point2(x,y)
  }
  constructor(
    readonly x: number, 
    readonly y: number
  ) {  }
...
}

const pointFactory = {
  Point2(x,y) { return new Point2(x,y) },
...
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions