Created
August 24, 2019 21:11
-
-
Save feynon/d906df2d4d559ea89b3f5b02632f523f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", function(event) { | |
var orderModule = (function() { | |
var orders = {}, | |
EST_DELIVERY = "current estimated delivery time", | |
estimatedDeliveryTime; | |
PubSub.subscribe(EST_DELIVERY, function(msg, data) { | |
console.log(msg); | |
estimatedDeliveryTime = data; | |
}); | |
return orders; | |
})(); | |
var deliveryModule = (function() { | |
var deliveries = {}, | |
EST_DELIVERY = "current estimated delivery time"; | |
deliveries.getEstimatedDeliveryTime = function() { | |
var estimatedDeliveryTime = 1; // Hard-coded to 1 hour, but likely an API call. | |
PubSub.publish(EST_DELIVERY, estimatedDeliveryTime); | |
}; | |
return deliveries; | |
})(); | |
deliveryModule.getEstimatedDeliveryTime(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment