dmikester1D
Reactiflux4y ago
3 replies
dmikester1

dmikester1 – 18-12 Nov 23

I have this function in my React app that makes an api call that does some work that might take some time and I do not want to wait for it to finish.
    const switchShifts = async () => {
      console.log({ bagCounts });
      const completedOrders = orders
        .filter((o) => o.DATE_COMPLETED !== null)
            .map((o) => {
        return { orderID: o.ORDER_ID, GUID: o.ORDER_GUID };
            });
        completeOrdersInBC(completedOrders);
            // more code to run down here without waiting for 'completeOrdersInBC'
            ...
        };
Was this page helpful?