You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only way the delay setting gets applied is if you use createUtils, passing in the sameprefix as you passed when rendering MSWToolbar, and make use of the json or notFound response helpers or use the getDelay function yourself when creating your request handlers.
This connection feels tenuous. Might an alternative API be:
rather than MSWToolbar receiving a prop worker: SetupWorkerApi | undefined it
receives a getWorker: ((utils): { getDelay: () => number } => Promise<SetupWorkerApi> | SetupWorkerApi) | undefined
That way it's more obvious how one applies the delay setting to their request handlers.
Currently the only way the
delay
setting gets applied is if you usecreateUtils
, passing in the sameprefix
as you passed when renderingMSWToolbar
, and make use of thejson
ornotFound
response helpers or use thegetDelay
function yourself when creating your request handlers.This connection feels tenuous. Might an alternative API be:
MSWToolbar
receiving a propworker: SetupWorkerApi | undefined
itgetWorker: ((utils): { getDelay: () => number } => Promise<SetupWorkerApi> | SetupWorkerApi) | undefined
That way it's more obvious how one applies the delay setting to their request handlers.
The text was updated successfully, but these errors were encountered: