question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Future API changes

See original GitHub issue

continuing the discussion from https://github.com/emmanueltouzery/prelude.ts/pull/8

@qm3ster => all good points, food for thought. Note that prelude.ts has a Stream collection type and yes it works as you described. I would consider renaming the on* methods and have them possibly returning void instead of returning the Future, but I’m not sure for the name right now (maybe onFailed=>ifFail, onSucceeded=>ifSuccess, onCompleted=>match or matchValue), or even if that’s really the good path forward. That’s also connected to some changes I’m working on in these methods regarding error handling.

And besides that I think yes probably map & flatMap should be lazy, and we can also add an explicit. .trigger() (with in apidoc that you don’t need it if you do await, or if you do X or Y and so on). The trigger would likely return void.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
emmanueltouzerycommented, Aug 15, 2018

I started working on a PR in which I would remove laziness and also take into account feedback on the current API from @qm3ster (who had other comments besides the laziness/eagerness), and also add the do-like constructor. I didn’t strongly decide to remove laziness, but I figure also in other areas prelude.ts tried to keep things simple and working in the way people expect them to be.

I’ll submit this through a PR so that people can comment on the changes. I’m still open for feedback on the laziness/eagerness aspect! Implementation simplicity is also a (lesser) concern.

1reaction
emmanueltouzerycommented, Aug 14, 2018

clearly my worry is that someone forgets to call trigger. I’m thinking about adding some constructor Future.run, or renaming Future.of to Future.run. But I must think it through.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Future Changes to the API and Data Feeds - NVD
In late 2023, the NVD will retire its data feeds while working to guide any legacy users to updated application-programming interfaces (APIs).
Read more >
Change Log – Binance API Documentation - GitHub Pages
Some orders that were cancelled/expired will be removed gradually from API endpoints. These endpoints are affected:
Read more >
enabling the future of GitHub's REST API with API versioning
We'll only use versioning for breaking changes. Non-breaking changes will continue to be available across all API versions. Note: calendar-based ...
Read more >
REST and the future of APIs - Level Up Coding
Whenever someone starts talking about web services and APIs, you will eventually land on a discussion about whether to use REST or some...
Read more >
Future of API Management 2nd Edition - Group Futurista
The number of APIs is rising at an exponential rate, thanks to the rise of Internet Business Models, IoT, social media, and Cloud...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found