Merge pull request #859 from Demonthos/use-shared-state-futures

Make use_shared_state usable in static futures
This commit is contained in:
Jon Kelley authored and GitHub committed 2023-03-02 11:46:58 -08:00
commit 5b61cbb9a0
3 files changed
+135 -95

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ fn main() {}
struct AppSettings {}
// ANCHOR: wrap_context
fn use_settings(cx: &ScopeState) -> UseSharedState<AppSettings> {
fn use_settings(cx: &ScopeState) -> &UseSharedState<AppSettings> {
use_shared_state::<AppSettings>(cx).expect("App settings not provided")
}
// ANCHOR_END: wrap_context