IssueRaiser

Support cold event streams in templates

# Requirements * [R1] Observables must be cold (ie if there is no subscription then there should be no listeners.) USE CASE: drag and drop. No need to listen on mousemove if drag has not been initiated. * [R2] It must be possible to execute an expression which computes the action which will be next-ed into the observable. - USE CASE: ngFor shows a list of todos with a remove button. Clicking the remove should notify the stream not with the DOM event, but with the item to be removed. * [R3] It must be possible to set up observable recipes to run inside/outside of angular zone. - USE CASE: - drag and drop. Don't run CD on mousemove. - Throttle; debounce; etc..: Only run CD on subscription which pass throttle, debounce; etc. * [R4] It would be strongly preferable if there was something in the template which would indicate that an observable is listening at a given location. - USE CASE: it should be easy for the developer/tooling to see where in the source code the event will be processed. # Design * Component will annotate fields which will represent Observable Streams which will be created by the Template's ViewFactory. [R4] (This will also determine the parameterization for the Observables. (ie `Observable<MyType>)`) - The Framework will set those fields right after constructing the object. We need a new hook (`ngOnCreate`) which would be called right after setting the fields but before running first change detection (`ngOnChanges`, `ngOnInit`). * Create

Posted by mhevery on Dec 5, 2016, 7:51 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

support (SaaS)

Support cold event streams in templates

mheveryDec 5, 2016, 7:51 PM

# Requirements * [R1] Observables must be cold (ie if there is no subscription then there should be no listeners.) USE CASE: drag and drop. No need to listen on mousemove if drag has not been initiated. * [R2] It must be possible to execute an expression which computes the action which will be next-ed into the observable. - USE CASE: ngFor shows a list of todos with a remove button. Clicking the remove should notify the stream not with the DOM event, but with the item to be removed. * [R3] It must be possible to set up observable recipes to run inside/outside of angular zone. - USE CASE: - drag and drop. Don't run CD on mousemove. - Throttle; debounce; etc..: Only run CD on subscription which pass throttle, debounce; etc. * [R4] It would be strongly preferable if there was something in the template which would indicate that an observable is listening at a given location. - USE CASE: it should be easy for the developer/tooling to see where in the source code the event will be processed. # Design * Component will annotate fields which will represent Observable Streams which will be created by the Template's ViewFactory. [R4] (This will also determine the parameterization for the Observables. (ie `Observable<MyType>)`) - The Framework will set those fields right after constructing the object. We need a new hook (`ngOnCreate`) which would be called right after setting the fields but before running first change detection (`ngOnChanges`, `ngOnInit`). * Create

Comments (0)

No comments yet. Start the discussion.

Comment on this issue