██████╗ ███████╗ █████╗ ██████╗████████╗██╗██╗ ██╗ █████╗ ████████╗███████╗
██╔══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝██║██║ ██║██╔══██╗╚══██╔══╝██╔════╝
██████╔╝█████╗ ███████║██║ ██║ ██║██║ ██║███████║ ██║ █████╗
██╔══██╗██╔══╝ ██╔══██║██║ ██║ ██║╚██╗ ██╔╝██╔══██║ ██║ ██╔══╝
██║ ██║███████╗██║ ██║╚██████╗ ██║ ██║ ╚████╔╝ ██║ ██║ ██║ ███████╗
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝
------------------------------------------------------------------------------
Thread Safe Reactive Data Structure. Made with ❤️ for 🦀
[![Crates.io](https://img.shields.io/crates/v/reactivate.svg)](https://crates.io/crates/reactivate)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
## 🚀 Installation
include it in your `Cargo.toml` under `[dependencies]`
```toml
reactivate = { version = "*", features = ["threadsafe"] }
```
## 🧑💻 Usage examples
### 🏗️ Construction
```rust
use reactivate::Reactive;
fn main() {
let r = Reactive::new(10);
println!("{:?}", r); // Reactive(10)
println!("{:?}", r.value()); // 10
}
```
### 🔥 Derive
```rust
use reactivate::Reactive;
fn main() {
let r = Reactive::new(10);
let d = r.derive(|val| val + 5);
println!("{:?}", r); // Reactive(10)
println!("{:?}", d); // Reactive(15)
}
```
### ✨ Update
```rust
use reactivate::Reactive;
fn main() {
let r = Reactive::new(10);
let d = r.derive(|val| val + 5);
r.update(|_| 20);
println!("{:?}", r); // Reactive(20)
println!("{:?}", d); // Reactive(25)
}
```
### ⚡ Update Inplace
```rust
use reactivate::Reactive;
fn main() {
let r = Reactive::new(vec![1, 2, 3]);
let d = r.derive(|nums| nums.iter().sum::