summaryrefslogtreecommitdiffstats
path: root/web/src/subscription.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-18 23:57:02 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-18 23:57:02 +0100
commit9ca65c9f18454ba2bb3ff5667d9618a1491771db (patch)
treee1cb5b415fc64fd169509fcf98f74819a856e674 /web/src/subscription.rs
parent0f2e20f5e5b1f0658ab4e6cbe6fdda9ca97f2b36 (diff)
downloadiced-9ca65c9f18454ba2bb3ff5667d9618a1491771db.tar.gz
iced-9ca65c9f18454ba2bb3ff5667d9618a1491771db.tar.bz2
iced-9ca65c9f18454ba2bb3ff5667d9618a1491771db.zip
Fix missing `Subscription` type in `iced_web`
Diffstat (limited to 'web/src/subscription.rs')
-rw-r--r--web/src/subscription.rs19
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;