Open kikuomax opened 6 years ago
How about to add a hook function to the arguments of the requestIntradayTimeSeries function? A hook function might look like,
requestIntradayTimeSeries
async function hookFunction(userId, request, payload): void
where
userId
request
payload
It should not block so that requestIntradayTimeSeries can immediately return the results.
We might simplify the arguments as shown below,
async function hookFunction(request, payload): void
Because request.auth.credentials.userId will contain a user ID. See #2.
request.auth.credentials.userId
oops!
How about to add a hook function to the arguments of the
requestIntradayTimeSeries
function? A hook function might look like,where
userId
: the Fitbit user IDrequest
: the request parameterspayload
: the results of the requestIt should not block so that
requestIntradayTimeSeries
can immediately return the results.