Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 handleResults(results) { | |
const errors = results | |
.filter(result => result.status === 'rejected') | |
.map(result => result.reason) | |
if (errors.length) { | |
throw new AggregateError(errors) | |
} | |
return results.map(result => result.value) |
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
async function loadInitialData() { | |
// fire and await together | |
const [userResult, productResult, otherResult] = | |
await Promise.allSettled([ | |
fetchUser(), fetchProduct(), fetchOther() | |
]) | |
// process user | |
if (userResult.status === '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
function onReject(err) { | |
return err | |
} | |
async function loadInitialData() { | |
//fire and await together | |
const [user, product, other] = await Promise.all([ | |
fetchUser().catch(onReject), | |
fetchProduct().catch(onReject) |
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
async function loadInitialData() { | |
const userPromise = fetchUser(); | |
const productPromise = fetchProduct(); | |
const otherPromise = fetchOther(); | |
// all of them running simultaneously | |
try { | |
const user = await userPromise; |
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
async function loadInitialData(){ | |
//let's assume that each request will take 600ms | |
try { | |
const user = await fetchUser(); // run 1st | |
const product = await fetchProduct(); // wait 600ms for user req to run | |
const other = await fetchOther(); // wait 600ms for product req to run | |
} catch(error) { |
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
v -0.179050 1.274588 -0.040381 | |
v -0.169976 1.289133 0.016252 | |
v -0.290684 1.201673 -0.067585 | |
v -0.226036 1.372423 -0.089406 | |
v -0.254926 1.364176 0.000148 | |
v -0.099124 1.420458 0.068408 | |
v -0.221071 1.439538 0.015189 | |
v -0.152510 1.440512 -0.105643 | |
v -0.033935 1.328884 0.116747 | |
v -0.324122 1.243871 -0.016855 |
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
import React, {useState} from 'react'; | |
import {Text, View, StyleSheet} from 'react-native'; | |
import LottieView from 'lottie-react-native'; | |
const App = () => { | |
const [lottieLoaded, setLottieLoaded] = useState(false); | |
if (!lottieLoaded) { | |
return ( | |
<View style={styles.text}> |
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
<script type="text/javascript" id="bloomerangForm2705410"></script> | |
<pre><script type="text/javascript"> | |
var insertForm2705410 = function() { | |
var html2705410 = '<style text=\'text/css\'>' + | |
'.interaction-form label{color: #404040;' + | |
' display: block;}' + | |
'' + | |
'.interaction-form label.error{color:#900;' + | |
' display: inline-block; ' + | |
' padding: 0 10px;}' + |
NewerOlder