⌈⌋ ⎇ branch:  Bitrhythm


Hex Artifact Content

Artifact b1b8f0c654ecd3fc9a9667252bfc77dceee6347bdd72b2522d6eb18cf16fd890:


0000: 3c 64 65 66 65 72 72 65 64 2d 63 68 69 6c 64 2d  <deferred-child-
0010: 32 3e 0a 20 20 3c 70 3e 49 20 61 6d 20 74 68 65  2>.  <p>I am the
0020: 20 64 65 66 65 72 72 65 64 2d 63 68 69 6c 64 2d   deferred-child-
0030: 32 3c 2f 70 3e 0a 0a 20 20 74 68 69 73 2e 6f 6e  2</p>..  this.on
0040: 28 27 6d 6f 75 6e 74 27 2c 20 66 75 6e 63 74 69  ('mount', functi
0050: 6f 6e 28 29 20 7b 0a 20 20 20 20 6f 70 74 73 2e  on() {.    opts.
0060: 6f 6e 6d 6f 75 6e 74 28 27 64 65 66 65 72 72 65  onmount('deferre
0070: 64 2d 63 68 69 6c 64 2d 32 27 2c 20 74 68 69 73  d-child-2', this
0080: 29 0a 20 20 7d 29 0a 3c 2f 64 65 66 65 72 72 65  ).  }).</deferre
0090: 64 2d 63 68 69 6c 64 2d 32 3e 0a 0a 3c 64 65 66  d-child-2>..<def
00a0: 65 72 72 65 64 2d 6c 6f 6f 70 3e 0a 20 20 3c 70  erred-loop>.  <p
00b0: 3e 49 20 61 6d 20 74 68 65 20 64 65 66 65 72 72  >I am the deferr
00c0: 65 64 2d 6c 6f 6f 70 3c 2f 70 3e 0a 0a 20 20 74  ed-loop</p>..  t
00d0: 68 69 73 2e 6f 6e 28 27 6d 6f 75 6e 74 27 2c 20  his.on('mount', 
00e0: 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 20 20 20  function() {.   
00f0: 20 6f 70 74 73 2e 6f 6e 6d 6f 75 6e 74 28 27 64   opts.onmount('d
0100: 65 66 65 72 72 65 64 2d 6c 6f 6f 70 27 2c 20 74  eferred-loop', t
0110: 68 69 73 29 0a 20 20 7d 29 0a 3c 2f 64 65 66 65  his).  }).</defe
0120: 72 72 65 64 2d 6c 6f 6f 70 3e 0a 0a 3c 64 65 66  rred-loop>..<def
0130: 65 72 72 65 64 2d 63 68 69 6c 64 2d 31 3e 0a 20  erred-child-1>. 
0140: 20 3c 70 3e 49 20 61 6d 20 74 68 65 20 64 65 66   <p>I am the def
0150: 65 72 72 65 64 2d 63 68 69 6c 64 2d 31 3c 2f 70  erred-child-1</p
0160: 3e 0a 20 20 3c 64 65 66 65 72 72 65 64 2d 63 68  >.  <deferred-ch
0170: 69 6c 64 2d 32 20 6f 6e 6d 6f 75 6e 74 3d 7b 20  ild-2 onmount={ 
0180: 6f 70 74 73 2e 6f 6e 6d 6f 75 6e 74 20 7d 3e 3c  opts.onmount }><
0190: 2f 64 65 66 65 72 72 65 64 2d 63 68 69 6c 64 2d  /deferred-child-
01a0: 32 3e 0a 20 20 3c 64 65 66 65 72 72 65 64 2d 6c  2>.  <deferred-l
01b0: 6f 6f 70 20 6f 6e 6d 6f 75 6e 74 3d 7b 20 70 61  oop onmount={ pa
01c0: 72 65 6e 74 2e 6f 70 74 73 2e 6f 6e 6d 6f 75 6e  rent.opts.onmoun
01d0: 74 20 7d 20 65 61 63 68 3d 7b 20 69 74 65 6d 73  t } each={ items
01e0: 20 7d 3e 3c 2f 64 65 66 65 72 72 65 64 2d 6c 6f   }></deferred-lo
01f0: 6f 70 3e 0a 0a 20 20 74 68 69 73 2e 69 74 65 6d  op>..  this.item
0200: 73 20 3d 20 5b 7b 7d 2c 7b 7d 2c 7b 7d 2c 7b 7d  s = [{},{},{},{}
0210: 2c 7b 7d 5d 0a 0a 20 20 74 68 69 73 2e 6f 6e 28  ,{}]..  this.on(
0220: 27 6d 6f 75 6e 74 27 2c 20 66 75 6e 63 74 69 6f  'mount', functio
0230: 6e 28 29 20 7b 0a 20 20 20 20 6f 70 74 73 2e 6f  n() {.    opts.o
0240: 6e 6d 6f 75 6e 74 28 27 64 65 66 65 72 72 65 64  nmount('deferred
0250: 2d 63 68 69 6c 64 2d 31 27 2c 20 74 68 69 73 29  -child-1', this)
0260: 0a 20 20 7d 29 0a 3c 2f 64 65 66 65 72 72 65 64  .  }).</deferred
0270: 2d 63 68 69 6c 64 2d 31 3e 0a 0a 3c 64 65 66 65  -child-1>..<defe
0280: 72 72 65 64 2d 6d 6f 75 6e 74 3e 0a 20 20 3c 70  rred-mount>.  <p
0290: 3e 49 20 61 6d 20 74 68 65 20 70 61 72 65 6e 74  >I am the parent
02a0: 3c 2f 70 3e 0a 20 20 3c 64 65 66 65 72 72 65 64  </p>.  <deferred
02b0: 2d 63 68 69 6c 64 2d 31 20 6f 6e 6d 6f 75 6e 74  -child-1 onmount
02c0: 3d 7b 20 6f 70 74 73 2e 6f 6e 6d 6f 75 6e 74 20  ={ opts.onmount 
02d0: 7d 3e 3c 2f 64 65 66 65 72 72 65 64 2d 63 68 69  }></deferred-chi
02e0: 6c 64 2d 31 3e 0a 0a 20 20 74 68 69 73 2e 6f 6e  ld-1>..  this.on
02f0: 28 27 6d 6f 75 6e 74 27 2c 20 66 75 6e 63 74 69  ('mount', functi
0300: 6f 6e 28 29 20 7b 0a 20 20 20 20 6f 70 74 73 2e  on() {.    opts.
0310: 6f 6e 6d 6f 75 6e 74 28 27 64 65 66 65 72 72 65  onmount('deferre
0320: 64 2d 6d 6f 75 6e 74 27 2c 20 74 68 69 73 29 0a  d-mount', this).
0330: 20 20 7d 29 0a 3c 2f 64 65 66 65 72 72 65 64 2d    }).</deferred-
0340: 6d 6f 75 6e 74 3e                                mount>