Pauan / rust-signals

Zero-cost functional reactive Signals for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add in custom Poll for Signal

Pauan opened this issue · comments

commented

Rather than a Signal returning Poll<Option<Self::Item>>, instead it should return a custom enum, like this:

enum SignalPoll<A> {
    Done(Option<A>),
    Changed(A),
    NotChanged,
}

This will make it possible to always poll the Signal a single time (rather than continuing to poll repeatedly).