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`.
- 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
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`
- A bunch of new codecs are available. Have a look at the docs for crate `codee`.
- `use_websocket`:
- `UseWebsocketOptions` has been renamed to `UseWebSocketOptions` (uppercase S) to be consistent with the return
type.

View file

@ -276,13 +276,17 @@ where
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
let notify_id = create_memo::<usize>(move |prev| {
notify.track();
match prev {
None => 1, // Avoid async fetch of initial value
Some(prev) => {
fetch_from_storage();
prev + 1
let notify_id = create_memo::<usize>({
let fetch_from_storage = fetch_from_storage.clone();
move |prev| {
notify.track();
match prev {
None => 1, // Avoid async fetch of initial value
Some(prev) => {
fetch_from_storage();
prev + 1
}
}
}
});