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

Automatically clear expired objects #294

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

007-Heroa
Copy link

No description provided.

lukeswitz added a commit to lukeswitz/Cache that referenced this pull request Jul 21, 2022
@ajain26
Copy link

ajain26 commented Feb 2, 2024

it will be great if you add some description to the PR.

Copy link

@ajain26 ajain26 left a comment

Choose a reason for hiding this comment

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

Please update the code with latest swift syntex

}

public func applyExpiratonMode(_ expirationMode: ExpirationMode) {
if let didEnterBackgroundObserver = didEnterBackgroundObserver {
Copy link

Choose a reason for hiding this comment

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

Suggested change
if let didEnterBackgroundObserver = didEnterBackgroundObserver {
if let didEnterBackgroundObserver {

object: nil,
queue: nil)
{ [weak self] _ in
guard let `self` = self else { return }
Copy link

Choose a reason for hiding this comment

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

Suggested change
guard let `self` = self else { return }
guard let self else { return }


public extension Storage {
func applyExpiratonMode(_ expirationMode: ExpirationMode) {
self.hybridStorage.applyExpiratonMode(expirationMode)
Copy link

Choose a reason for hiding this comment

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

Suggested change
self.hybridStorage.applyExpiratonMode(expirationMode)
hybridStorage.applyExpiratonMode(expirationMode)

NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification,
object: nil,
queue: nil) { [weak self] _ in
guard let `self` = self else { return }
Copy link

Choose a reason for hiding this comment

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

Suggested change
guard let `self` = self else { return }
guard let self else { return }

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.

3 participants