Skip to content

dragfire/aoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust-y went reactive!!

Implementing a very bare-bone reactivex for learning purposes by following https://github.com/rxRust/rxRust
http://reactivex.io

Example:

Only Map and Filter operators are supported right now. :D

fn main() {
    println!("Rust-y went Reactive!!");

    let mut total = 0;

    observable::from_iter(vec![1, 2, 3, 4, 5, 6])
        .map(|v| v + 100)
        .filter(|v| v % 2 == 0)
        .map(|v| v - 100)
        .map(|v| v * 100)
        .subscribe(|v| {
            total += v;
        });

    assert_eq!(1200, total);
}

About

Rust-y went Reactive!!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages