Skip to content

Commit

Permalink
doc: Clarify how store can be accessed outside of components (#66)
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Beberweil <christophbeberweil@Venus2.local>
  • Loading branch information
christophbeberweil and Christoph Beberweil authored Nov 28, 2023
1 parent f2283a5 commit b57cf7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ read and write changes to state in various ways.

# Creating a Dispatch

To create a dispatch, you need only provide the desired store type.
To create a dispatch, you need only provide the desired store type. This is available in **any** rust code, not just yew components.

```rust
let dispatch = Dispatch::<Counter>::new();
```

A dispatch is also given when using the functional hook.
A dispatch is also given when using the functional hook, which is only available in yew components.

```rust
let (state, dispatch) = use_store::<Counter>();
Expand Down

0 comments on commit b57cf7a

Please sign in to comment.