Created
June 19, 2024 22:23
-
-
Save nestarz/c8ec71944f533b5006b18313190956ad to your computer and use it in GitHub Desktop.
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 { renderToReadableStream } from "jsr:@bureaudouble/[email protected]/react-server-dom-esm/server.edge"; | |
import { cache } from "jsr:@bureaudouble/[email protected]/react.react-server"; | |
import { createElement } from "jsr:@bureaudouble/[email protected]/react.react-server"; | |
const getId = cache(() => ({ id: Math.random() })); | |
const A = async () => { | |
await new Promise((res) => setTimeout(res, 10)); | |
const id = getId(); | |
console.log(id); | |
return null; | |
}; | |
const B = async () => { | |
const id = getId(); | |
console.log(id); | |
return createElement(A, {}, null); | |
}; | |
renderToReadableStream(createElement(B, {}, null), null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment