diff options
author | 2019-12-19 17:07:20 +0100 | |
---|---|---|
committer | 2019-12-19 17:07:20 +0100 | |
commit | 9cf61fb82cb715ab0af15343be258b2b227d85f4 (patch) | |
tree | 1a6460ba8981b0bcef2bd64e975e0021425ac823 /web/src/subscription.rs | |
parent | c822ea753e6121cc53aa1a75112af6063e3e06dd (diff) | |
parent | 68c8ebcd775416d5eb8efa9c095bbe1d44d964ad (diff) | |
download | iced-9cf61fb82cb715ab0af15343be258b2b227d85f4.tar.gz iced-9cf61fb82cb715ab0af15343be258b2b227d85f4.tar.bz2 iced-9cf61fb82cb715ab0af15343be258b2b227d85f4.zip |
Merge pull request #131 from hecrj/fix/web-subscription-missing
Fix `Subscription` missing in `iced_web`
Diffstat (limited to 'web/src/subscription.rs')
-rw-r--r-- | web/src/subscription.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/src/subscription.rs b/web/src/subscription.rs new file mode 100644 index 00000000..4638c8ab --- /dev/null +++ b/web/src/subscription.rs @@ -0,0 +1,19 @@ +//! Listen to external events in your application. +use crate::Hasher; + +/// A request to listen to external events. +/// +/// Besides performing async actions on demand with [`Command`], most +/// applications also need to listen to external events passively. +/// +/// A [`Subscription`] is normally provided to some runtime, like a [`Command`], +/// and it will generate events as long as the user keeps requesting it. +/// +/// For instance, you can use a [`Subscription`] to listen to a WebSocket +/// connection, keyboard presses, mouse events, time ticks, etc. +/// +/// [`Command`]: ../struct.Command.html +/// [`Subscription`]: struct.Subscription.html +pub type Subscription<T> = iced_core::Subscription<Hasher, (), T>; + +pub use iced_core::subscription::Recipe; |