Some data (like urls & cookies) are stored in the prototype
& properties of the generated api. This can cause a problem
when you instantiate 2 api objects with different data, since
cookies can get mixed up. This fixes it by putting the whole
constructor in a closure so that a new function is used for
each instantiation of the API.
Some data (like urls & cookies) are stored in the prototype & properties of the generated api. This can cause a problem when you instantiate 2 api objects with different data, since cookies can get mixed up. This fixes it by putting the whole constructor in a closure so that a new function is used for each instantiation of the API.