Feat: update solved problems with context API
This commit is contained in:
1 parent
24e8bcb028
commit
c97a9647e3
7 files changed
+209
-9
No files matched your search
@@ -1068,9 +1068,10 @@ pub fn attr<'a>(name: &'a str, value: &'a str) -> Attribute<'a> {
|
||||
/// // do something when a click happens...
|
||||
/// });
|
||||
/// ```
|
||||
pub fn on<'a, F>(bump: &'a Bump, event: &'a str, callback: F) -> Listener<'a>
|
||||
pub fn on<'a, 'b, F: 'b>(bump: &'a Bump, event: &'a str, callback: F) -> Listener<'a>
|
||||
where
|
||||
F: Fn(()) + 'a,
|
||||
'b: 'a + 'static,
|
||||
F: Fn(()) + 'b,
|
||||
{
|
||||
Listener {
|
||||
event,
|
||||
|
||||
@@ -174,7 +174,11 @@ mod velement {
|
||||
}
|
||||
|
||||
/// An event listener.
|
||||
pub struct Listener<'a> {
|
||||
pub struct Listener<'a>
|
||||
// pub struct Listener<'a, 'b>
|
||||
// where
|
||||
// 'b: 'a + 'static,
|
||||
{
|
||||
/// The type of event to listen for.
|
||||
pub(crate) event: &'a str,
|
||||
/// The callback to invoke when the event happens.
|
||||
|
||||
Reference in new issue
Block a user