2023-06-16 19:33:55 +01:00
use default_struct_builder ::DefaultBuilder ;
use leptos ::* ;
///
///
/// ## Demo
///
/// [Link to Demo](https://github.com/Synphonyte/leptos-use/tree/main/examples/{{ function_name }})
///
/// ## Usage
///
/// ```
/// # use leptos::*;
2023-07-14 05:48:37 +01:00
/// # use leptos_use{{#if module}}::{{ module }}{{/if}}::{{ function_name }};
2023-06-16 19:33:55 +01:00
/// #
/// # #[component]
2023-07-27 18:06:36 +01:00
/// # fn Demo() -> impl IntoView {
/// {{ function_name }}();
2023-06-16 19:33:55 +01:00
/// #
2023-07-27 18:06:36 +01:00
/// # view! { }
2023-06-16 19:33:55 +01:00
/// # }
2023-06-23 22:04:16 +01:00
/// ```{{#if feature}}
2023-06-24 01:12:43 +01:00
// #[doc(cfg(feature = "{{feature}}"))]{{/if}}
2023-07-27 18:06:36 +01:00
pub fn { { function_name } } ( ) -> { { to_pascal_case function_name } } Return {
{ { function_name } } _with_options ( { { to_pascal_case function_name } } Options ::default ( ) )
2023-06-16 19:33:55 +01:00
}
2023-06-23 22:04:16 +01:00
/// Version of [`{{ function_name }}`] that takes a `{{ to_pascal_case function_name }}Options`. See [`{{ function_name }}`] for how to use.{{#if feature}}
2023-06-24 01:12:43 +01:00
// #[doc(cfg(feature = "{{feature}}"))]{{/if}}
2023-07-27 18:06:36 +01:00
pub fn { { function_name } } _with_options ( options : { { to_pascal_case function_name } } Options ) -> { { to_pascal_case function_name } } Return {
2023-06-16 19:33:55 +01:00
{ { to_pascal_case function_name } } Return { }
}
2023-06-23 22:04:16 +01:00
/// Options for [`{{ function_name }}_with_options`].{{#if feature}}
2023-06-24 01:12:43 +01:00
// #[doc(cfg(feature = "{{feature}}"))]{{/if}}
2023-06-16 19:33:55 +01:00
#[ derive(DefaultBuilder) ]
pub struct { { to_pascal_case function_name } } Options { }
impl Default for { { to_pascal_case function_name } } Options {
fn default ( ) -> Self {
Self { }
}
}
2023-06-24 01:12:43 +01:00
/// Return type of [`{{ function_name }}`].{{#if feature}}
// #[doc(cfg(feature = "{{feature}}"))]{{/if}}
2023-06-16 19:33:55 +01:00
pub struct { { to_pascal_case function_name } } Return { }