Skip to content

Conversation

mrousavy
Copy link
Member

Remove the static singleton pattern from the app.

The idea is that we have one default context (one member of WorkletsApi), and everything else is instance based so it has to be passed down to callers.

I also want to add a global.__dispatcher to every Runtime so that it's easy to find your way back into a Runtime after dispatching away from it (e.g. for callbacks or to resolve promises).
Those dispatchers can always be held with weak_ptrs, so if they ever go out of scope, you know that the runtime was deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant