Guest User

Untitled

a guest
Mar 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. var Service = (function() {
  2.  
  3. function doStuff(command, package) {
  4. var response = ""
  5.  
  6. switch(command) {
  7. case "A":
  8. response = a(package);
  9. break;
  10. case "B":
  11. response = b(package);
  12. break;
  13. case "C":
  14. response = c(package);
  15. break;
  16. default:
  17. // should never get here
  18. response = "NOPE!";
  19. }
  20.  
  21. return response;
  22. }
  23.  
  24. function a(package) {
  25. // do stuff
  26. }
  27.  
  28. function b(package) {
  29. // do stuff
  30. }
  31.  
  32. function c(package) {
  33. // do stuff;
  34. }
  35.  
  36. return {
  37. doStuff: doStuff,
  38. a: a,
  39. b: b,
  40. c: c
  41. }
  42. });
  43.  
  44. module.exports = Service;
Add Comment
Please, Sign In to add comment