#Help with currying methods

1 messages · Page 1 of 1 (latest)

obtuse shoreBOT
#

@marble dagger Here's a shortened URL of your playground link! You can remove the full link from your message.

lielmus#0

Preview:```ts
// #####################################################################################
// Music module
// #####################################################################################

function playMusic(params: { songId: string }) {
return { action: "playMusic" };
...```

floral kraken
#

@marble dagger so that you can do things like modules.pauseMusic(true).sendWrestler(boris).playMusic(boris.getThemeSong()); ??

#

That's chaining, not currying, it's a different thing

#

I don't see a use case for currying here, at least

#

For chaining all you need is to have all functions inside a single object, and every function returning the object that contains them