Introduction

Bounce

crates.io | docs.rs | GitHub

Bounce is a state-management library focusing on simplicity and performance.

Bounce is inspired by Redux and Recoil.

Rationale

Yew state management solutions that are currently available all have some (or all) of the following limitations:

  • Too much boilerplate.

    Users either have to manually control whether to notify subscribers or have to manually define contexts.

  • State change notifies all.

    State changes will notify all subscribers.

  • Needless clones.

    A clone of the state will be produced for all subscribers whenever there's a change.

Bounce wants to be a state management library that:

  • Has minimal boilerplate.

    Changes are automatically detected via PartialEq.

  • Only notifies relevant subscribers.

    When a state changes, only hooks that subscribe to that state will be notified.

  • Reduces Cloning.

    States are Rc'ed.

Installation

You can add it to your project with the following command:

cargo add bounce

You can also add it to the Cargo.toml of your project manually:

bounce = "0.9"

Getting Started

If you want to learn more about Bounce, you can check out the tutorial and the API documentation.

Licence

Bounce is dual licensed under the MIT license and the Apache License (Version 2.0).