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
const{ AsyncParallelBailHook }=require("tapable");consthook=newAsyncParallelBailHook();hook.tapPromise('A',()=>newPromise(res=>setTimeout(()=>res(undefined),100)));hook.tapPromise('B',()=>newPromise(res=>setTimeout(()=>res('B'),5000)));// <= last to resolvehook.tapPromise('C',()=>newPromise(res=>setTimeout(()=>res('C'),500)));hook.promise().then(console.log);
Expected (hook is expected to use value from the third tap)
C
Actual (hook uses value from second tap instead)
B
The text was updated successfully, but these errors were encountered:
This is working as expected. It's not a race, it returns the first defined value by plugin order. This way the behavior is always deterministic and independent of timing.
I see, thx for clarification @sokra !
Would it be possible to point me to a doc/reference that explains more about the plugin order
I think that will help me figure out how to use tapable for my use-case and maybe add a test case to help others understand the expected behavior
Consider this example
Expected (hook is expected to use value from the third tap)
Actual (hook uses value from second tap instead)
The text was updated successfully, but these errors were encountered: