Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. console.log("in systemjs config");
  2.  
  3. SystemJS.config({
  4. map: {
  5. 'wire': 'app/Test/js'
  6. },
  7. packages: {
  8. 'wire': {
  9. main: './sum.js'
  10. }
  11. }
  12. }
  13. });
  14.  
  15. SystemJS.import('wire').then(function(wire) {
  16. console.log('Module', wire);
  17. });
  18. console.log("end of systemjs config");
  19.  
  20. console.log("inside sum file first line");
  21. var reduce = require("./reduce");
  22. var add = require("./add");
  23. function sum(list){
  24. return reduce(list, add, 0);
  25. };
  26. module.exports = sum;
  27. console.log("inside sum file");
  28.  
  29. function reduce(list, iteratee, memo) {
  30. list.forEach(function (item) {
  31. memo = iteratee(item, memo);
  32. });
  33. return memo;
  34. }
  35. module.exports = reduce;
  36.  
  37. function add(a,b){
  38. return a + b;
  39. }
  40. module.exports = add;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement