staltz / fantasy-observable

A specification for interoperability of push-based data sources in JavaScript
42 stars 3 forks source link

complete argument doesn't compose, should be removed #2

Closed trxcllnt closed 7 years ago

trxcllnt commented 7 years ago

Observables are push-duals of Enumerables (lists). The notion of a "return" value isn't a thing enumerating a list of values. Even in JS, where the concept was added to support coroutines, it's rarely used, and widely seen as a mistake and source of pain. Return values don't compose through all possible operations, which will confuse and demoralize people. Let's correct this mistake early on.

staltz commented 7 years ago

I agree with you, the only reason it's there is because most.js uses this argument: https://github.com/cujojs/most/blob/master/docs/api.md#streamsubscribeobserver---subscription and I want to provide maximum interoperability between libraries. Note: it's an optional argument.

I'll ask @briancavalier to weigh in on this issue.

briancavalier commented 7 years ago

I'm ok w/removing it here and deprecating it in most.

staltz commented 7 years ago

Good, so it's resolved. https://github.com/staltz/fantasy-observable/commit/d7c8ca65b5a77949d5a809b5f749b17f7955cca3