Advertisement
Guest User

Untitled

a guest
Nov 9th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. return view.extend({
  2.   load: function() {
  3.     return Promise.all([
  4.       new Promise(function(resolveFn, rejectFn) {
  5.         document.querySelector('head').appendChild(E('script', {
  6.           src: 'blah.js',
  7.           load: resolveFn,
  8.           error: rejectFn
  9.         }));
  10.       }),
  11.       new Promise(function(resolveFn, rejectFn) {
  12.         document.querySelector('head').appendChild(E('script', {
  13.           src: 'blah2.js',
  14.           load: resolveFn,
  15.           error: rejectFn
  16.         }));
  17.       }),
  18.       new Promise(function(resolveFn, rejectFn) {
  19.         document.querySelector('head').appendChild(E('script', {
  20.           src: 'blah3.js',
  21.           load: resolveFn,
  22.           error: rejectFn
  23.         }));
  24.       })
  25.     ]);
  26.   },
  27.   render: function() {
  28.     ...
  29.   }
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement