Skip to content

apply a (asynchronous) function to an object and return this object

License

Notifications You must be signed in to change notification settings

xiechao06/oapply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oapply

DEPRECATED! please use apply-with instead!

apply a (asynchronous) function to an object and return this object, similar to kotlin's apply

quickstart

$ npm i oapply

test

$ npm run test

example

oapply(
  Promise.resolve({ a: 1 }),
  it => ++it.a,
  it => { it.a += 2 }
).then(it => console.log(it.a)) // output 4

About

apply a (asynchronous) function to an object and return this object

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published