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

Possible to import Lockr as non-global? #61

Open
sumeetattree opened this issue Nov 25, 2018 · 1 comment
Open

Possible to import Lockr as non-global? #61

sumeetattree opened this issue Nov 25, 2018 · 1 comment

Comments

@sumeetattree
Copy link

I've come across a situation where I need to use Lockr in two different places with different prefixes. But Locker.prefix = 'new_prefix_' will just override the old one. Is this possible at all?

Thanks for this amazing library!

@tsironis
Copy link
Owner

tsironis commented Mar 6, 2023

I'm not sure if the latest rewrite in Typescript and the subsequent release of v0.9.0-beta.2 solves this issue. Honestly, I don't think it does by default, but I'm confident it lays the foundation to offer this kind of functionality.

I would expect to be able to explicitly set the prefix key before using any setter functions, but then you will have to make sure that any asynchronous code is not affected by changing the prefix in other place in your codebase.

Let me know how that works for you, or if you need any clarifications.

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