MCPcopy Create free account
hub / github.com/coderarmy-notes/mern-stack-course / pickupOrder

Function pickupOrder

03JS/Day19/index.js:164–182  ·  view source on GitHub ↗
(orderDetail)

Source from the content-addressed store, hash-verified

162
163
164function pickupOrder(orderDetail){
165 console.log(`Delivery boy is on way to pickup order from ${orderDetail.restaurant_location} `);
166
167 return new Promise((resolve,reject)=>{
168
169
170 setTimeout(()=>{
171 if(Math.random()>0.05){
172 console.log("I have picked up the order");
173 orderDetail.received = true;
174 resolve(orderDetail);
175 }
176 else{
177 reject("Delivery boy Unable to reach restaurant")
178 }
179 },3000);
180 })
181
182}
183
184
185function deliverOrder(orderDetail){

Callers 1

index.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected