forward({from, to})
Sends data from one entity to another
Arguments
config
({from: Unit<T>, to: Unit<T>})
Returns
(Subscription
)
Example
Send event data to store
const event = createEvent()
const proxy = createStore(-1)
proxy.watch(data => console.log('data: ', data))
// data: -1
// data: 1
forward({
from: event,
to: proxy,
})
event(1)
event(1)