I have this function:
//We will store any failed subscriptions and retry them until the succeed (if ever)
addFailedSubscription: function(streamId) {
failedSubscriptions[streamId] = true;
$timeout(function() {
failedSubscriptions[streamId] = null;
}, 5000);
}
Is this safe? How is it that streamId is available to the timeout function after the function has returned? Is it effectively creating a closure for this function?
Thanks