Molybden API
Loading...
Searching...
No Matches
molybden::Event< T > Class Template Reference

Events allow you to be notified when something happens in Molybden. More...

#include <event.hpp>

Public Types

using Signature = void(const T &e)
 The observer's signature.
 

Public Member Functions

std::shared_ptr< Subscriptionoperator+= (std::function< Signature > observer)
 Subscribes to receiving a notification when the event occurs.
 

Friends

class ObservableOwner
 

Detailed Description

template<typename T>
class molybden::Event< T >

Events allow you to be notified when something happens in Molybden.

Unlike delegates, events are asynchronous and do not block the underlying Chromium engine.

Template Parameters
Tthe event type.

Member Function Documentation

◆ operator+=()

template<typename T >
std::shared_ptr< Subscription > molybden::Event< T >::operator+= ( std::function< Signature observer)

Subscribes to receiving a notification when the event occurs.

Use the following approach to subscribe to receiving events:

event += [](const T& event) {};

Use the Subscription.cancel() method to unsubscribe from receiving events.


The documentation for this class was generated from the following file: