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

Default manager export #2

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

pdspicer
Copy link

Added a default storage manager to main export, as well as a config() method for the StorageManager class in order to reconfigure the default storage manager without reinstantiating. This allows callers to do storage manager setup once at application start and reuse the same instances without needing to require() a separate file where a configured StorageManager has been set up. This is a similar pattern to how popular database and logging libraries export default containers for connections or loggers. Seeing as storage drivers fall under a similar class of reusability throughout an application, use of this pattern seems appropriate in this library.

Note: I submitted this to slynova-org as well, but that repo doesn't seem to be particularly active, and seeing as you've put all this work into actually making some active improvements I figured I'd just try here instead of publishing yet another version of this library.

Additional note: I did some incredibly minor cleanup both for eslint as well as for the actual build (needed to add 'dom' to the lib in tsconfig), don't know if this is something that has changed in the last two months or what.. regardless its just a type checking thing, don't think it actually impacts any of the output.

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