Skip to content
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

[Feature request]: Add a signal to PropertyType #2543

Closed
NachoSoto opened this issue Nov 9, 2015 · 9 comments
Closed

[Feature request]: Add a signal to PropertyType #2543

NachoSoto opened this issue Nov 9, 2015 · 9 comments

Comments

@NachoSoto
Copy link
Member

I think this was debated at some point but I can't find any other issue.

It would be nice if PropertyType also exposed a Signal<Value, NoError>. Of course we can do property.producer.skip(1), but it would be nice to have its own method to expose this with the right no-side-effects semantics.

@neilpa
Copy link
Member

neilpa commented Nov 9, 2015

I would take this a step further to say that PropertyType should conform to both SignalType and SignalProducerType.

@neilpa neilpa added this to the 4.0 milestone Nov 9, 2015
@NachoSoto
Copy link
Member Author

Yes, absolutely! But that's going to require higher-kinded types so that things like SignalType.map can return Self<Value, Error>.

@neilpa
Copy link
Member

neilpa commented Nov 9, 2015

Nope, SignalType exposes signal: Signal<Value, Error> and doesn't use Self because of that.

@NachoSoto
Copy link
Member Author

I would take this a step further to say that PropertyType should conform to both SignalType and SignalProducerType.

What I mean is that operators, like map, are implemented on SignalType, but they can't return Self<Value, Error>, they incorrectly return Signal.

If PropertyType were to conform to SignalType, for example, doing property.map would return a Signal, which is wrong. It should return another property of the same type.

That's why I'm saying that unfortunately what you suggest is not possible right now.

@neilpa
Copy link
Member

neilpa commented Nov 10, 2015

they incorrectly return Signal.

I wouldn't call this incorrect given that this is a language limitation and there's nothing we can do to workaround it.

@NachoSoto
Copy link
Member Author

For sure, hence the italic :)

@paulyoung
Copy link
Contributor

It was originally brought up in #2146. I wish I had this all the time but never got around to it.

@NachoSoto
Copy link
Member Author

@neilpa do you have any further thoughts on this?

Given that, as I explained, we can't make it conform to SignalType yet, seems like an appropriate temporary solution to simply add a Signal.

This isn't blocking 4.0 though, of course.

@neilpa
Copy link
Member

neilpa commented Nov 17, 2015

Nope, we should just go ahead and add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants