pub fn generate_subscription_function(
config: &SubscriptionConfig,
) -> TokenStreamExpand description
Generate the subscription function for the application
This generates a subscription_model() function that creates Iced subscriptions
for system theme changes when follow_system is enabled in the theme configuration.
§Arguments
config- Subscription configuration
§Returns
TokenStream containing the subscription function
§Example Output
ⓘ
pub fn subscription_model() -> iced::Subscription<Message> {
if app_follows_system() {
dampen_iced::watch_system_theme()
.map(Message::SystemThemeChanged)
} else {
iced::Subscription::none()
}
}