-
Notifications
You must be signed in to change notification settings - Fork 515
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
Validate shape of cacheMap on initialization #86
Conversation
Hmm, I'm having some trouble figuring out how code coverage dropped. It looks like the new test should exercise the added functionality, but maybe I'm overlooking something simple. EDIT: Turns out it was untested lines in the new test. |
bdf8e0b
to
e323ec6
Compare
* Functions should avoid being defined within another function body if possible * Naming consistency * Flow typing * Arrow functions with a single return statement should not use block format * Check typeof 'function' instead of non-falsey * filter(Boolean) to remove falsey values
src/index.js
Outdated
@@ -305,6 +304,24 @@ function failedDispatch<K, V>( | |||
}); | |||
} | |||
|
|||
function getValidCacheMap<K, V>( | |||
options: Options<K, V> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty new to flow, but shouldn't this be options?
?
Addresses #82
Checks to see if custom cache map has the required methods on initialization. The documentation just says it needs to be an object with a similar API to Map but the DataLoader only uses those 4 methods, so I figured it was okay to selectively check for those.