You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const exchangeRate = signal(0,
// Callback triggered when the signal begins to observe something.
() => {
const timer = setTimeout(async () => {
// Fetch the current exchange rate (of type number) using a request (fetch).
const currentExchangeRate: number = await fetch( .... );
// Set the exchange rate signal's value to the current rate.
exchangeRate.value = currentExchangeRate
});
// Callback triggered when the signal stops observing something.
return () => {
// Clear the timer.
clearInterval(timer);
};
}
);
This callback could behave like this:
For example, MobX implements it like this:
https://mobx.js.org/lazy-observables.html
The text was updated successfully, but these errors were encountered: