I'm trying to find the best practice of implementing the following:
I have 3 functions: manager
, httpGet
and onsuccess
:
manager
calls thehttpGet
function and passes theonsuccess
function to be called upon success.httpGet
makes a request and invokesonsuccesss
onsuccess
uses needs params frommanager
What is the best way to pass and argument from manager
to onsuccess
without involving httGet
?
I was thinking about passing a params
object to httpGet
which in turn will be passed to onsuccess
but I really don't like the idea of passing params to a function that doesn't use them at all.