I would look at this as an opportunity, because the design you have now does not provide any way for GlobalProvider
to signal changes in any of these variables. Incidentally, you should not be manually instantiating Promise
s as setCustomerId
is currently doing: see this article for why. Also see this post for example code involving this general idiom.