Enable instant only for wasm32 targets
... and hide the dependency under a `time` module in `iced_native`
This commit is contained in:
parent
776724162a
commit
87b3e03d18
6 changed files with 19 additions and 6 deletions
|
|
@ -1,12 +1,12 @@
|
|||
//! Listen and react to time.
|
||||
pub use crate::runtime::time::{Duration, Instant};
|
||||
|
||||
use crate::Subscription;
|
||||
|
||||
/// Returns a [`Subscription`] that produces messages at a set interval.
|
||||
///
|
||||
/// The first message is produced after a `duration`, and then continues to
|
||||
/// produce more messages every `duration` after that.
|
||||
pub fn every(
|
||||
duration: std::time::Duration,
|
||||
) -> Subscription<std::time::Instant> {
|
||||
pub fn every(duration: Duration) -> Subscription<Instant> {
|
||||
iced_futures::time::every(duration)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue