fixed compile error with use_storage

This commit is contained in:
Maccesch 2024-07-26 10:36:39 +01:00
parent c6005079e1
commit ffd4f0a6fe
2 changed files with 13 additions and 8 deletions

View file

@ -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.

View file

@ -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
}
} }
} }
}); });