Renderers are now packages, not features. (#387)
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
This commit is contained in:
1 parent
c97ca7dff6
commit
d9546d9504
181 files changed
+487
-1463
No files matched your search
@@ -36,14 +36,14 @@ Fermi is a global state management solution for Dioxus that's as easy as `use_st
|
||||
|
||||
Inspired by atom-based state management solutions, all state in Fermi starts as an `atom`:
|
||||
|
||||
```rust
|
||||
```rust, ignore
|
||||
static NAME: Atom<&str> = |_| "Dioxus";
|
||||
```
|
||||
|
||||
From anywhere in our app, we can read our the value of our atom:
|
||||
|
||||
```rust
|
||||
fn NameCard(cx: Scope) -> Element {
|
||||
```rust, ignore
|
||||
fn NameCard(cx: Scope) -> Element {
|
||||
let name = use_read(&cx, NAME);
|
||||
cx.render(rsx!{ h1 { "Hello, {name}"} })
|
||||
}
|
||||
@@ -51,8 +51,8 @@ fn NameCard(cx: Scope) -> Element {
|
||||
|
||||
We can also set the value of our atom, also from anywhere in our app:
|
||||
|
||||
```rust
|
||||
fn NameCard(cx: Scope) -> Element {
|
||||
```rust, ignore
|
||||
fn NameCard(cx: Scope) -> Element {
|
||||
let set_name = use_set(&cx, NAME);
|
||||
cx.render(rsx!{
|
||||
button {
|
||||
@@ -68,7 +68,7 @@ It's that simple!
|
||||
## Installation
|
||||
Fermi is currently under construction, so you have to use the `master` branch to get started.
|
||||
|
||||
```rust
|
||||
```toml
|
||||
[dependencies]
|
||||
fermi = { git = "https://github.com/dioxuslabs/fermi" }
|
||||
```
|
||||
@@ -89,4 +89,4 @@ Broadly our feature set to required to be released includes:
|
||||
- [ ] Support for Atom Families
|
||||
- [ ] Support for memoized Selectors
|
||||
- [ ] Support for memoized SelectorFamilies
|
||||
- [ ] Support for UseFermiCallback for access to fermi from async
|
||||
- [ ] Support for UseFermiCallback for access to fermi from async
|
||||
@@ -124,7 +124,7 @@ impl<T: 'static> AtomState<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage:
|
||||
/// ```rust
|
||||
/// ```rust, ignore
|
||||
/// # use dioxus_core::prelude::*;
|
||||
/// # use dioxus_hooks::*;
|
||||
/// fn component(cx: Scope) -> Element {
|
||||
@@ -219,7 +219,7 @@ impl<T: Clone> AtomState<T> {
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// let val = use_state(&cx, || 0);
|
||||
///
|
||||
/// val.with_mut(|v| *v = 1);
|
||||
@@ -242,7 +242,7 @@ impl<T: Clone> AtomState<T> {
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// let val = use_state(&cx, || 0);
|
||||
///
|
||||
/// *val.make_mut() += 1;
|
||||
|
||||
Reference in new issue
Block a user