CrowdHailer / fn.js

A JavaScript library built to encourage a functional programming style & strategy. - http://eliperelman.com/fn.js
MIT License
399 stars 30 forks source link

Should the arguments to fn.is be reversed? #10

Closed eliperelman closed 10 years ago

eliperelman commented 10 years ago

Current .is() API:

fn.is( value, type ) where type is a string type returned by fn.type. Having the value come before the type means you cannot create a version with the type partially applied. If the API were:

fn.is( type, value )

then you could do:

var isFunction = fn.partial( fn.is, 'function' );

This would be a breaking API change, so I want to open for discussion before making changes if anyone has any objections.

alFReD-NSH commented 10 years ago

I think it should be fn.is( type, value ). The type always comes first.

davidchase commented 10 years ago

+1 :thumbsup: for type then value

eliperelman commented 10 years ago

Cool, I'll go ahead and make this change after I have the new build system in place. Thanks!

eliperelman commented 10 years ago

This is now in v0.8.0 with fed32709942e7d988c377e7bf3c120fde3a1d72b. Updates to docs forthcoming.