pub fn of_fn<F, Item>(f: F) -> CallableObservable<F> where
    F: FnOnce() -> Item, 
Expand description

Creates an observable that emits the return value of a callable.

Never emits an error.

Arguments

  • f - A function that will be called to obtain its return value to emits.

Examples

use rxrust::prelude::*;

observable::of_fn(|| {1234})
  .subscribe(|v| {println!("{},", v)});