std1.0.0-beta-7 SafeC docs

std :: reactive::signal

Function std::signal_subscribe

#include <std/reactive/signal.h> source

generic<T, U> void signal_subscribe(&Signal<T> s, fn void(?&U) listener, ?&U userdata)

Registers listener(userdata) to run on every future set()/notify(). Not called for the initial value — read it directly after subscribing. A free function: U is its own type parameter, and an instance method of a generic struct can't add type parameters of its own yet.