Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Shared Data/State #32

Open
kalisjoshua opened this issue Oct 18, 2023 · 1 comment
Open

Global Shared Data/State #32

kalisjoshua opened this issue Oct 18, 2023 · 1 comment

Comments

@kalisjoshua
Copy link

Is there a way to "hide" the globally available strawberry object? I'd like to use this for a game and I am not figuring out how to hide access to the initialized reactive data object.

@18alantom
Copy link
Owner

18alantom commented Oct 23, 2023

You can kinda hide the reactive data object by calling sb.init inside a non global scope. But subsequent calls to sb.init returns the same object.

Will have to push an update that makes multiple calls to sb.init a no-op that returns undefined, the sb object would still be available though.


Possible solution #33 ∵ ESM modules don't share global state and imports aren't accessible from the console.

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

No branches or pull requests

2 participants