constsignal$ = Signal<number>(true, (r) => { r.sub(signal$, (value) =>console.log(`${value} was published in the signal`)) }) //... functionMyComponent() { constpub = usePublisher(signal$); return<buttononClick={() =>pub(2)}>Push a value into the signal</button> }
Returns a function that publishes its passed argument into the specified node.