#mutable #size #macro #signals #test #horrid #mutables

macro mutablex

A horrid macro for making mutables of X size

2 releases

0.1.1 Mar 14, 2024
0.1.0 Feb 13, 2024

#344 in Procedural macros

Download history 35/week @ 2024-02-13 14/week @ 2024-02-20 13/week @ 2024-02-27 1/week @ 2024-03-05 153/week @ 2024-03-12 11/week @ 2024-03-19 7/week @ 2024-03-26 30/week @ 2024-04-02

202 downloads per month

MIT license

6KB
103 lines

MutableX

Create X-sized mutable signals for FutureSignals.

Usage

From tests/basic.rs

#[cfg(test)]
pub mod test {
    use futures_signals::signal::{Mutable, SignalExt};
    use mutablex::mutable_x;

    #[test]
    pub fn basic() {
        mutable_x!(2);

        let stream_a = Mutable::new(1);
        let stream_b = Mutable::new(2);

        let combination = Mutable2::new(stream_a.clone(), stream_b.clone());

        let _ = combination.map(|(a, b)| {
            println!("{} {}", a, b);
        });

        stream_a.set(3);
        stream_b.set(4);
    }
}

Dependencies

~1.6–2.4MB
~48K SLoC