Hi Christine. I believe you have an anomaly in your clean up example. The type of the return of your unsubscribePlayers(players) call is not specified, so the return may be misleading, as a call to unsubscribe the players immediately before returning. For the clean up to work properly, you must return a function that will be called when needed. Perhaps you meant the following:
return (() => unsubscribePlayers(players));
However, I could be wrong, since the function call unsubscribePlayers may indeed return a function.
Hi Christine. I believe you have an anomaly in your clean up example. The type of the return of your
unsubscribePlayers(players)
call is not specified, so the return may be misleading, as a call to unsubscribe the players immediately before returning. For the clean up to work properly, you must return a function that will be called when needed. Perhaps you meant the following:However, I could be wrong, since the function call
unsubscribePlayers
may indeed return a function.Anyway, nice post! Keep it up, very entertaining.
Hey Polar, good catch, thank you. I've updated it :)