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

remove CacheConf; add tests for utils/conf #204

Merged
merged 2 commits into from Apr 15, 2018
Merged

remove CacheConf; add tests for utils/conf #204

merged 2 commits into from Apr 15, 2018

Conversation

@vutran
Copy link
Member

@vutran vutran commented Apr 15, 2018

This diff removes utils/CacheConf (temporarily; a todo has been added for reimplementing caching which can be discussed in a new thread).

This also includes a spec file for utils/conf.

@vutran
Copy link
Member Author

@vutran vutran commented Apr 15, 2018

Let me updated conf as well.

expect(conf.get('foo')).toBe('bar');
expect(conf.store).toEqual({ foo: 'bar' });
expect(conf.size).toBe(1);
});

This comment has been minimized.

// resolve and update the state
Promise.resolve(content).then(html => {
cacheConf.set(cacheKey, html);

This comment has been minimized.

@adnasa

adnasa Apr 15, 2018
Member

aah cool.
Isn't it a matter of replacing this with config.set(), since conf actually inherits from Conf ? :bowtie:

maybe that doesn't work and I'm missing something.

This comment has been minimized.

@vutran

vutran Apr 15, 2018
Author Member

I thought about it but conf in itself never expires whereas in this context, we want the item details content to expire since plugin may be querying an API (github README, etc.)

This comment has been minimized.

@vutran

vutran Apr 15, 2018
Author Member

I just removed it for now to keep the function cleaner. I think there's a better way to go about caching without having it too coupled with our fetch functions.

@adnasa
adnasa approved these changes Apr 15, 2018
Copy link
Member

@adnasa adnasa left a comment

removing code when it helps less is better.

@adnasa
Copy link
Member

@adnasa adnasa commented Apr 15, 2018

don't forget the closes #-- before you merge 😉

@vutran vutran merged commit f4e24a5 into develop Apr 15, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@vutran vutran deleted the 197-consolidate-conf branch Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.