mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 00:59:22 -05:00
fixed compile error with use_storage
This commit is contained in:
parent
c6005079e1
commit
ffd4f0a6fe
2 changed files with 13 additions and 8 deletions
|
@ -44,8 +44,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- `JsonCodec` has been renamed to `JsonSerdeCodec`.
|
- `JsonCodec` has been renamed to `JsonSerdeCodec`.
|
||||||
- The feature to enable this codec is now called `json_serde` instead of just `serde`.
|
- The feature to enable this codec is now called `json_serde` instead of just `serde`.
|
||||||
- `ProstCodec` now encodes as binary data. If you want to keep using it with string data you can wrap it like
|
- `ProstCodec` now encodes as binary data. If you want to keep using it with string data you can wrap it like
|
||||||
this: `Base64<ProstCodec>`. You have to enable both features `prost` and `base64` for this.
|
this: `Base64<ProstCodec>`.
|
||||||
- All of these structs, traits and features now live in their own crate called `codee`
|
- All of these structs, traits and features now live in their own crate called `codee`
|
||||||
|
- A bunch of new codecs are available. Have a look at the docs for crate `codee`.
|
||||||
- `use_websocket`:
|
- `use_websocket`:
|
||||||
- `UseWebsocketOptions` has been renamed to `UseWebSocketOptions` (uppercase S) to be consistent with the return
|
- `UseWebsocketOptions` has been renamed to `UseWebSocketOptions` (uppercase S) to be consistent with the return
|
||||||
type.
|
type.
|
||||||
|
|
|
@ -276,13 +276,17 @@ where
|
||||||
let notify = create_trigger();
|
let notify = create_trigger();
|
||||||
|
|
||||||
// Refetch from storage. Keeps track of how many times we've been notified. Does not increment for calls to set_data
|
// Refetch from storage. Keeps track of how many times we've been notified. Does not increment for calls to set_data
|
||||||
let notify_id = create_memo::<usize>(move |prev| {
|
let notify_id = create_memo::<usize>({
|
||||||
notify.track();
|
let fetch_from_storage = fetch_from_storage.clone();
|
||||||
match prev {
|
|
||||||
None => 1, // Avoid async fetch of initial value
|
move |prev| {
|
||||||
Some(prev) => {
|
notify.track();
|
||||||
fetch_from_storage();
|
match prev {
|
||||||
prev + 1
|
None => 1, // Avoid async fetch of initial value
|
||||||
|
Some(prev) => {
|
||||||
|
fetch_from_storage();
|
||||||
|
prev + 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue