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

New singleton implementation that removes all statics #1

Closed
wants to merge 1 commit into from

Conversation

alexchuber
Copy link
Owner

An idea for enforcing singleton pattern w/o using statics

Export the singleton at the module level. Do not export the class.
To export this singleton without the heavy overhead of the old constructor, separate it into a new initialize method that users must call. This has the nice side effect of forcing users to be intentional with the lifecycle management of a DracoDecoder.

In case the singleton pattern is a Mistake, we can always go back and expose the class to users?

All of this is based on the idea that a module-level singleton is even a good idea... TBD?

@alexchuber alexchuber force-pushed the draco-compression-no-statics branch from 0a2680a to ce32f9d Compare December 9, 2024 01:36
@alexchuber alexchuber force-pushed the draco-compression-no-statics branch from ce32f9d to 5e66a45 Compare December 9, 2024 01:39
@alexchuber alexchuber closed this Dec 16, 2024
@alexchuber alexchuber deleted the draco-compression-no-statics branch February 7, 2025 19:24
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