dioxus-std icon indicating copy to clipboard operation
dioxus-std copied to clipboard

Fix Storage Doc Discrepancies

Open DogeDark opened this issue 1 year ago • 3 comments

Some of the docs for the storage feature of SDK look to be incorrect. For example, the use_persistent hook has the doc:

A persistent storage hook that can be used to store data across application reloads.

I don't believe the latter bolded/italic part of this doc is correct, at least on the Web platform. We should look for all discrepancies and correct them.

DogeDark avatar May 09 '24 00:05 DogeDark

I just ran into this. The doc states that

A persistent storage hook that can be used to store data across application reloads.

Depending on the platform this uses either local storage or a file storage

However, in use use_persistent appears to use session storage instead of local storage, which means that the data does not persist across application reloads on web/fullstack. Tested on Firefox.

Image

Image

It seems like the intended behavior is to use local storage instead of session storage?

Lekyaira avatar Mar 14 '25 22:03 Lekyaira

I think use_synced_storage exists to provide a version which can span multiple sessions (Actually uses local storage), but I'm not sure. Docs to need some improvements as to what the intended semantics are.

Craig-Macomber avatar May 31 '25 19:05 Craig-Macomber

Either way the documentation would be incorrect, no?

Lekyaira avatar Aug 23 '25 16:08 Lekyaira