/// Register a subscribe handle to confirm navigation when Url Requested.
/// Mostly to be used inside init() in Seed.
/// ```rust
/// extern crate seed_routing;
/// #[macro_use]
/// use seed_routing::{View, *};
/// use seed::prelude::*;
/// add_router!();
/// // Empty Model for example
/// struct Model {
///     // Empty for example
/// }
///
/// fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
///     orders.subscribe(Msg::UrlChanged);
///     router().init(url).subscribe(orders.subscribe_with_handle(
///         |subs::UrlRequested(requested_url, _)| router().confirm_navigation(requested_url),
///     ));
///
///     Model {
/// // Empty for example
/// }
/// }
/// enum Msg {
///     UrlChanged(subs::UrlChanged),
/// }
///
/// #[derive(Debug, PartialEq, Clone, ParseUrl, WithDefaultRoute)]
/// pub enum Routes {
///     #[default_route]
///     NotFound,
/// }
/// ```
Register a subscribe handle to confirm navigation when Url Requested.
Mostly to be used inside init() in Seed.
```rust
extern crate seed_routing.
Register a subscribe handle to confirm navigation when Url Requested . Mostly to be used inside init () in Seed . ` ` ` rust extern crate seed_routing .
pub fn subscribe(&self, sub_handle: SubHandle) -> &Self {
        self.clone()
            .update_data(|data| data.sub_handle = Some(sub_handle));
        self
    }
pub fn subscribe ( & self , sub_handle : SubHandle ) -> & Self { self . clone ( ) . update_data ( | data | data . sub_handle = Some ( sub_handle ) ) ; self }
Register a subscribe handle to confirm navigation when Url Requested.
Register a subscribe handle to confirm navigation when Url Requested .
&self
sub_handle
SubHandle
[macro_use]
use seed_routing::{View, *};
use seed::prelude::*;
add_router!();
Empty Model for example
struct Model {
Empty for example
}

fn init(url: Url, orders: &mut impl Orders) -> Model {
orders.subscribe(Msg::UrlChanged);
router().init(url).subscribe(orders.subscribe_with_handle(
|subs::UrlRequested(requested_url, _)| router().confirm_navigation(requested_url),
)).

Model {
Empty for example
}
}
enum Msg {
UrlChanged(subs::UrlChanged),
}
use seed_routing :: { View * } ; use seed :: prelude :: * ; add_router! () ; Empty Model for example struct Model { Empty for example } fn init ( url : Url orders : &mut impl Orders ) - > Model { orders . subscribe ( Msg :: UrlChanged ) ; router () . init ( url ) . subscribe ( orders . subscribe_with_handle ( |subs :: UrlRequested ( requested_url _ ) | router () . confirm_navigation ( requested_url ) )) . Model { Empty for example } } enum Msg { UrlChanged ( subs :: UrlChanged ) }
[derive(debug, partialeq, clone, parseurl, withdefaultroute)]
pub enum Routes {
[default_route]
NotFound,
}
```
pub enum Routes { [ default_route ] NotFound } ` ` `