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

Use Map instead of Object for caching #27

Open
atfera opened this issue Feb 16, 2023 · 0 comments · May be fixed by #43
Open

Use Map instead of Object for caching #27

atfera opened this issue Feb 16, 2023 · 0 comments · May be fixed by #43
Labels
enhancement New feature or request

Comments

@atfera
Copy link
Collaborator

atfera commented Feb 16, 2023

Map is probably better optimised than object for caching purpose.
Plus we can have a custom Map that handle jsMol delete directly:

class MolCache extends Map {
  delete(smiles) {
    const mol = this.get(smiles)
    mol?.delete()
    return super.delete(smiles);
  }
  
  clear() {
   // same, handle jsmol delete
  } 
}
@atfera atfera added the enhancement New feature or request label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant