-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could ObservableEvent
return a Subject?
#4
Comments
Otherwise, this is a great idea. 👍 Angular might take another year to do that cold observable thing. |
Oh good catch regarding the paths! I'll fix that ASAP. Regarding the decorator, it doesn't return anything but sets the value of the decorated target, which in this case is the template stream property. And the only job of the decorator right now is to create the subject property I see a couple of issues with introducing a configuration option for this, as that also needs to be reflected back to the template. And right now, there's no communication between the template engine and the decorator because those operate independently. The HTML transformation happens at build time and the decorator adds the subject at runtime. So even if we had an option that changes the value of the observable event property, then that would break the template. As a "workaround" for now, until we figure out a proper solution to this, is to declare the observable event property with two underscores and type it as a
Any ideas? |
Alright, import paths are fixed. |
Assign either |
Or introduce second decorator |
As mentioned in my comment earlier, this will be difficult because the HTML transformer and the transformer or the component class don't share state, and the HTML transformation assumes that there is a property For now I would suggest to simply define this property yourself on the class as you can see in my earlier code snippet. Does that work for you? In the meantime I'll think about how this could be achieved. FYI: I am also adding two more decorators |
But I am more than happy to look at a PR if you have an idea that works without introducing too much glue between the individual components. I would like to keep them decoupled as much as possible. |
The thing is, you sometimes want to trigger the event from both template and your class, this would require a mix of
ObservableEvent
and aSubject
. OrObservableEvent
could returnSubject
. Perhaps conditionally even?Btw all your import paths in readme are wrong, missing the
@typebytes
part.The text was updated successfully, but these errors were encountered: