Created
October 20, 2022 21:38
-
-
Save tomastrajan/f5a8b36ac9a02bdebedf66f9eea656e8 to your computer and use it in GitHub Desktop.
Angular DX syntax proposal - more decorators π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ /* ... */ }) | |
export class SomeComponent { | |
// streamifies input | |
@Input$() prop: Observable<string>; | |
// lifecycle notifier as an Observable stream | |
@OnDestroy$() destroy$: Obseravble<void>; | |
// lifecycle hook as decorator instead of implements interface | |
@OnInit() | |
init() { // could be any method name when used with decorator | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe the type of Subject could be modified within the Input$ options. And throttle and other could be added through pipes. I think the Decorator itself should not have to many options.