Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class Team {
  2. constructor() {
  3.  
  4.  
  5. }
  6.  
  7.  
  8. function getTeamInfo() {
  9.  
  10. this.teamPromise = new Promise({
  11. // Load the team meta data in here
  12. // Then resoolve the promise
  13.  
  14. })
  15.  
  16. }
  17. }
  18.  
  19.  
  20. class Match {
  21. constructor([arrayOfTeams]) {
  22.  
  23. var promiseArray = []
  24. for team in arrayOfTeams{
  25. promiseArray.push(team.teamPromise);
  26. }
  27.  
  28. Promise.all(promiseArray).({
  29. this.runMatch()
  30. })
  31.  
  32. }
  33.  
  34.  
  35. function runMatch() {
  36.  
  37. // This is only called when we have resolved all the promises that ONLY THIS MATCH is dependent on
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement