Skip to content

Instantly share code, notes, and snippets.

@zzdjk6
Last active May 17, 2020 05:15
Show Gist options
  • Save zzdjk6/a2b60e356555ae8bfa3b83eecd6ffa90 to your computer and use it in GitHub Desktop.
Save zzdjk6/a2b60e356555ae8bfa3b83eecd6ffa90 to your computer and use it in GitHub Desktop.
Data Guard Compose #EarlyReturn
const MyComponent: React.FC = () => {
return (
<Data1Guard>
{(data1) => (
<Data2Guard data1={data1}>
{(data2) => (
<AggregateDataGuard data1={data1} data2={data2}>
{(result) => <ResultDisplay result={result} />}
</AggregateDataGuard>
)}
</Data2Guard>
)}
</Data1Guard>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment