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

Create providers/decorators.js #1068

Merged
merged 5 commits into from
Apr 2, 2023
Merged

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Mar 12, 2023

This PR is mostly a refactor, but also add a new caching mechanic to:
songInfo.getImage() and notifications.[nativeImageToLogo() , saveImage()]

  • Adds the following pseudo decorators: (which are actually high order functions)

    • singleton
    • debounce
    • cache
    • throttle
    • memoize
    • retry
  • Implement the first 3 in a few plugins

you can find the decorators in providers/decorators.js

one day https://github.com/tc39/proposal-decorators will be available, and those pseudo decorators will be converted to actual decorators

TODO:
#1054 - 83abbdb (#1054) can use cache

@@ -16,7 +18,27 @@ module.exports = (_options) => {
}, { once: true, passive: true })
};

module.exports.moveVolumeHud = moveVolumeHud;
//without this function it would rewrite config 20 time when volume change by 20
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
//without this function it would rewrite config 20 time when volume change by 20
//without this function it would rewrite config 20 times when volume change by 20

@th-ch th-ch merged commit 99e0eec into th-ch:master Apr 2, 2023
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.

None yet

2 participants