Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. static register(typeName: string) {
  2. return function<T extends Constructor<BlogPostComponentInterface>>(ctor: T) {
  3. if (BlogPostTypeService.implementations.hasOwnProperty(typeName)) {
  4. console.error("This post type has already been registered. Did you forget to change the argument for @Register()?");
  5. }
  6. else {
  7. BlogPostTypeService.implementations[typeName] = ctor;
  8. }
  9. return ctor;
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement