Closed aklinker1 closed 1 year ago
I'd like to support executing functions directly, or executing functions in deeply nested in objects.
async function doWork() { ... } function createSomeService() { return { doWork }; } function createBackgroundAPI() { return { someService: createSomeService(), }, }
// ❌ This doesn't work today const [registerDoWork, getDoWork] = defineProxyService("doWork", () => doWork); // ✅ This works today const [registerSomeService, getSomeService] = defineProxyService("SomeService", () => createSomeService()); // ❌ This doesn't work today const [registerAPI, getAPI] = defineProxyService("API", () => createBackgroundAPI());
They could be used like so:
const doWork = getDoWork(); await doWork(); const someService = getSomeService(); await someService.doWork(); const api = getAPI(); api.someService.doWork();
I'd like to support executing functions directly, or executing functions in deeply nested in objects.
They could be used like so: