This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * Insert line break opportunities into a URL | |
| */ | |
| function formatUrl(url) { | |
| // Split the URL into an array to distinguish double slashes from single slashes | |
| var doubleSlash = url.split('//') | |
| // Format the strings on either side of double slashes separately | |
| var formatted = doubleSlash.map(str => | |
| // Insert a word break opportunity after a colon | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function createResource(promise) { | |
| let status = 'pending' | |
| let result = promise.then( | |
| resolved => { | |
| status = 'success' | |
| result = resolved | |
| }, | |
| rejected => { | |
| status = 'error' | |
| result = rejected | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| Returns controlled promise that we can resolve or reject when needed. | |
| */ | |
| function deferred() { | |
| let resolve, reject; | |
| const promise = new Promise((res, rej) => { | |
| resolve = res; | |
| reject = rej; | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* https://tobiasahlin.com/blog/how-to-animate-box-shadow/ */ | |
| .box { | |
| position: relative; | |
| display: inline-block; | |
| width: 100px; | |
| height: 100px; | |
| border-radius: 5px; | |
| background-color: #fff; | |
| box-shadow: 0 1px 2px rgba(0,0,0,0.15); |