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

adds input value as fn #97

Merged
merged 1 commit into from
Dec 28, 2017
Merged

Conversation

AutoSponge
Copy link
Contributor

see #95

@busypeoples
Copy link
Owner

Thanks @AutoSponge!
Will run this tomorrow and then merge.

reduce((result, key) => {
const value = input[key]
export const validate = curry((successFn: Function, failFn: Function, spec: Object, input: Object): Object => {
const inputFn = typeof input === 'function' ? input : (key?: string) => key ? input : input
Copy link
Owner

@busypeoples busypeoples Dec 16, 2017

Choose a reason for hiding this comment

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

input : (key?: string) => key ? input : input, why don't we just return (_key?: string) => input?
We don't seem to be doing anything with key anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's clearer in the test. key is optional as you can also provide a thunk or bound fn that ignores key.

Copy link
Owner

@busypeoples busypeoples Dec 16, 2017

Choose a reason for hiding this comment

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

Ok, let's keep the key ? input : input part, I don't mind and adapt when needed. Just want to make sure it's not confusing to people reading the code.

Copy link
Owner

Choose a reason for hiding this comment

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

Will merge tomorrow and release a new version. Thanks for all the work @AutoSponge!

@busypeoples
Copy link
Owner

This is good!

@busypeoples busypeoples merged commit 1624a15 into busypeoples:master Dec 28, 2017
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