Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Created November 30, 2021 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShopifyEng/05c1a47b3b69ed833fe4a3fc99a009b7 to your computer and use it in GitHub Desktop.
Save ShopifyEng/05c1a47b3b69ed833fe4a3fc99a009b7 to your computer and use it in GitHub Desktop.
Remote Rendering: Shopify’s Take on Extensible UI - Making remote procedure calls using `endpoint.expose` and `endpoint.call`
import { createEndpoint } from '@remote-ui/rpc';
const worker = new Worker('./script2.js');
const endpoint = createEndpoint(worker);
endpoint.call.theAnswer().then((value) => {
console.log(value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment