Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🍛 Bind (curry) with options object

License

NotificationsYou must be signed in to change notification settings

Hermanya/partial-application-with-named-parameters

Repository files navigation

Partial Application with Named ParametersBuild Status

screenshot

Usage

First have a function, that destructs its first and only parameter.This module will make you able to partially apply named parameters for that function.Take a look at tests to for details.

importtestfrom'ava';importbindablefrom'./';test('calculate sum',t=>{constreduce=bindable(function({reducer, initialValue, array}){returnarray.reduce(reducer,initialValue);});constreduceFromZero=reduce({initialValue:0});constarray=[1,2,3];t.is(reduceFromZero({reducer:(x,y)=>x+y,array}),6);});

License

MIT ©Herman Starikov


[8]ページ先頭

©2009-2025 Movatter.jp