Skip to content

Commit

Permalink
Merge pull request #27 from futursolo/book
Browse files Browse the repository at this point in the history
Add Bounce Docs
  • Loading branch information
futursolo authored May 1, 2022
2 parents 223c66e + d45a104 commit 625bfdd
Show file tree
Hide file tree
Showing 8 changed files with 740 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ crates/*/target
examples/*/target
examples/*/dist

book-build

Cargo.lock
82 changes: 82 additions & 0 deletions book-src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Introduction

<p style="text-align: center; font-size: 2rem;">Bounce</p>

<p style="text-align: center;">
<a href="https://crates.io/crates/bounce">
<img src="https://img.shields.io/crates/v/bounce" alt="crates.io">
</a>
|
<a href="https://docs.rs/bounce/">
<img src="https://docs.rs/bounce/badge.svg" alt="docs.rs">
</a>
|
<a href="https://github.com/futursolo/bounce">
<img src="https://img.shields.io/github/stars/futursolo/bounce?style=social" alt="GitHub">
</a>
</p>

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

Bounce is inspired by [Redux](https://github.com/reduxjs/redux) and
[Recoil](https://github.com/facebookexperimental/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

If you have [`cargo-edit`](https://github.com/killercup/cargo-edit)
installed,
you can add it to your project with the following command:

```shell
cargo add bounce
```

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

```toml
bounce = "0.3"
```

## Getting Started

If you want to learn more about Bounce, you can check out the
[tutorial](./tutorial.md) and the [API documentation](https://docs.rs/bounce/).

## Licence

Bounce is dual licensed under the MIT license and the Apache License (Version 2.0).
12 changes: 12 additions & 0 deletions book-src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SUMMARY

# Getting Started

- [Introduction](./README.md)
- [Tutorial](./tutorial.md)

# Reference

- [Core API](./core-api.md)
- [Helmet API](./helmet-api.md)
- [Query API](./query-api.md)
Loading

0 comments on commit 625bfdd

Please sign in to comment.