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
I regularly see subscription code using a Repeater instance and all of them have a resolve function alongside the subscribe function (example from the docs). However, I have noticed that if I use an async generator then that resolve function is not necessary (example from the docs).
I also get a type error if I use a repeater without a resolve function, whereas that doesn't happen when using an async generator. It is clear to that the function must be important.
My question is:
What is the purpose of the resolve function?
If my repeater yields the correct data type that's expected then is it possible to omit the usage of the resolve function without triggering a TS error?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I regularly see subscription code using a Repeater instance and all of them have a
resolve
function alongside thesubscribe
function (example from the docs). However, I have noticed that if I use an async generator then thatresolve
function is not necessary (example from the docs).I also get a type error if I use a repeater without a
resolve
function, whereas that doesn't happen when using an async generator. It is clear to that the function must be important.My question is:
resolve
function?resolve
function without triggering a TS error?Beta Was this translation helpful? Give feedback.
All reactions