BaseIdClass.ts 303 B

123456789101112131415161718
  1. import * as shortid from "shortid";
  2. /**
  3. * Support for the unique id generator.
  4. */
  5. export abstract class BaseIdClass {
  6. protected instanceId: string;
  7. constructor() {
  8. this.instanceId = shortid.generate();
  9. }
  10. public toString(): string {
  11. return this.instanceId;
  12. }
  13. }