sssignals

Crates.iosssignals
lib.rssssignals
version0.2.1
created_at2023-11-01 11:38:01.157233+00
updated_at2023-11-04 19:14:38.168226+00
description🐍 Simple, Synchronous Reactive Signals for Rust
homepage
repositoryhttps://github.com/Brian3647/sssignals
max_upload_size
id1020905
size10,755
vΓ­ctor (Brian3647)

documentation

README

🐍 SSSignals: Simple, Synchronous Reactive Signals for Rust

License GitHub issues Build status

SSSignals is a lightweight Rust library that provides simple, synchronous reactive signals. Signals are a powerful way to react to changes in values and design event-driven systems. With SSSignals, you can easily incorporate reactive programming into your Rust applications.

[Request a feature/Report a bug]

Features

  • πŸ“‘ Signal Creation: Create signals to hold values of any data type.
  • πŸ”„ Value Change Callbacks: Register callbacks that are triggered when the signal's value changes.
  • πŸ—Ί Value Transformation: Map the signal's value to a new value using a provided mapping function.
  • 🎯 Trait Implementations: Implements common Rust traits such as Display, Debug, and Default.

Usage

use sssignals::Signal;

fn main() {
    let mut signal = Signal::new(42);

    signal.on_change(|new, old| {
        println!("Value changed from {} to {}", old, new);
    });

    signal.set(43); // Prints "Value changed from 42 to 43"

    println!("{}", signal); // Prints "Signal(43)"
}

Installation

Run cargo add sssignals or add the following to your Cargo.toml file:

[dependencies]
sssignals = "*"

Documentation

For detailed information on how to use SSSignals, please refer to the official documentation.

Contributing

We welcome contributions from the open-source community. If you'd like to report a bug, request a feature, or contribute to the project, you can use the set templates.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 0

cargo fmt