/// Attaches an observer (a user-provided mutable closure) to the
/// stream, which consumes the stream object.
///
/// A stream with no observer attached is essentially just
/// a function of an observer; it will not react to incoming events
/// until it is subscribed to.
///
/// # Examples
///
/// ```
/// # use reactive_rs::*; use std::cell::RefCell;
/// let out = RefCell::new(Vec::new());
/// let stream = SimpleBroadcast::<i64>::new();
/// stream
///     .clone()
///     .filter(|x| x % 2 != 0)
///     .subscribe(|x| out.borrow_mut().push(*x));
/// stream.feed(0..=5);
/// assert_eq!(&*out.borrow(), &[1, 3, 5]);
/// ```
Attaches an observer (a user-provided mutable closure) to the
stream, which consumes the stream object.

A stream with no observer attached is essentially just
a function of an observer; it will not react to incoming events
until it is subscribed to.
Attaches an observer ( a user - provided mutable closure ) to the stream which consumes the stream object . A stream with no observer attached is essentially just a function of an observer ; it will not react to incoming events until it is subscribed to .
fn subscribe<O>(self, mut observer: O)
    where
        O: 'a + FnMut(&Self::Item),
    {
        self.subscribe_ctx(move |_ctx, item| observer(item))
    }
fn subscribe < O > ( self , mut observer : O ) where O : ' a + FnMut ( & Self :: Item ) , { self . subscribe_ctx ( move | _ctx , item | observer ( item ) ) }
Attaches an observer (a user-provided mutable closure) to the
stream, which consumes the stream object.
Attaches an observer ( a user - provided mutable closure ) to the stream which consumes the stream object .
self
observer
O
examples
None
use reactive_rs::*; use std::cell::refcell;
None