|
3 | 3 | use super::core::{Error, Event, Geocoordinates, Geolocator, PowerMode, Status}; |
4 | 4 | use dioxus::{ |
5 | 5 | prelude::{ |
6 | | - ReadOnlySignal, Signal, UnboundedReceiver, provide_context, try_consume_context, |
7 | | - use_coroutine, use_hook, use_signal, |
| 6 | + ReadSignal, Signal, UnboundedReceiver, provide_context, try_consume_context, use_coroutine, |
| 7 | + use_hook, use_signal, |
8 | 8 | }, |
9 | | - signals::{Readable, Writable}, |
| 9 | + signals::{ReadableExt, WritableExt}, |
10 | 10 | }; |
11 | 11 | use futures_util::stream::StreamExt; |
12 | 12 | use std::sync::Once; |
13 | 13 |
|
14 | 14 | static INIT: Once = Once::new(); |
15 | 15 |
|
16 | 16 | /// Provides the latest geocoordinates. Good for navigation-type apps. |
17 | | -pub fn use_geolocation() -> ReadOnlySignal<Result<Geocoordinates, Error>> { |
| 17 | +pub fn use_geolocation() -> ReadSignal<Result<Geocoordinates, Error>> { |
18 | 18 | // Store the coords |
19 | 19 | let mut coords: Signal<Result<Geocoordinates, Error>> = |
20 | 20 | use_signal(|| Err(Error::NotInitialized)); |
@@ -52,7 +52,7 @@ pub fn use_geolocation() -> ReadOnlySignal<Result<Geocoordinates, Error>> { |
52 | 52 | } |
53 | 53 | } |
54 | 54 |
|
55 | | - use_hook(|| ReadOnlySignal::new(coords)) |
| 55 | + use_hook(|| ReadSignal::new(coords)) |
56 | 56 | } |
57 | 57 |
|
58 | 58 | /// Must be called before any use of the geolocation abstraction. |
|
0 commit comments