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

implemented has method #46

Closed
wants to merge 1 commit into from

Conversation

schmunk42
Copy link
Contributor

@schmunk42 schmunk42 commented Apr 14, 2016

This is related to #37 (comment)

Note! This is implemented in an uncached version, which is not ideal.
But I ran into some complications, because I'd need to cache "all" values instead "active" (current default).
This also applies to _data which would also have to distinguish between "all" and "active".

Let me know your thoughts.

Btw: Is it by design that a key can exist twice?

@arisk
Copy link
Contributor

arisk commented Apr 15, 2016

How about if we implement has as a single query that fetches 1 value and just forgo caching in that case? Probably also make searching for disabled settings an optional param?
It is by design. A combination of section and key should form a unique value.

@schmunk42
Copy link
Contributor Author

It is by design. A combination of section and key should form a unique value.

Nice 👍 I misunderstood it first, I think.

Probably also make searching for disabled settings an optional param?

That's absolutely necessary.

How about if we implement has as a single query that fetches 1 value and just forgo caching in that case?

I would cache has() also, may also be called very often.

How about caching the whole settings and use has() in get()?

@arisk
Copy link
Contributor

arisk commented Apr 16, 2016

You're right. Probably the best idea is to use get to implement has. That way we inherit the caching functionality. The only consequence is that we will have to return all items including disabled items in getSettings(). So the settings array will actually have to hold a flag as to wether the item is disabled or not.

@schmunk42
Copy link
Contributor Author

Any thoughts about adding some tests by the way?

@arisk
Copy link
Contributor

arisk commented Apr 18, 2016

Sure. Definitely need unit tests for the component. I'll try to find time
to add some tests pretty soon.
On Apr 18, 2016 7:29 PM, "Tobias Munk" notifications@github.com wrote:

Any thoughts about adding some tests by the way?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#46 (comment)

@arisk arisk closed this in 913d91a Jun 6, 2016
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.

2 participants