Improved syntax for observable mapping and subscribing

Isiah Meadows isiahmeadows at gmail.com
Fri Mar 23 23:55:03 UTC 2018


I've already looked into this kind of thing myself privately. I came
up with this last year [1], and I more recently came up with this [2]
(the second is much better IMHO). Both of those offer solutions to
this problem, and they do in fact offer ways for 1. iteration, and 2.
mapping/filtering/etc.

[1]: https://github.com/isiahmeadows/non-linear-proposal
[2]: https://github.com/isiahmeadows/lifted-pipeline-strawman
-----

Isiah Meadows
me at isiahmeadows.com

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Fri, Mar 23, 2018 at 11:06 AM, Thomas Grainger <tagrain at gmail.com> wrote:
> You can convert an observable into an async iterator. You have to choose
> between discarding or buffering uniterated items
>
> On 23 Mar 2018 14:39, "Bob Myers" <rtm at gol.com> wrote:
>>
>> Could someone jog my memory about proposals for better syntax for
>> observable mapping and subscribing, if any?
>>
>> I'm getting really tired of writing
>>
>> ```
>> foo$.pipe(map(bar => mapper(bar)))
>> ```
>>
>> I would much prefer to write something along the lines of
>>
>> ```
>> stream function fooMapper(foo$) {
>>   while async (const bar = foo$()) {
>>     emit mapper(bar);
>>   }
>> }
>> ```
>>
>> Yes, I'm aware of all the potential issues here and this is just an
>> example, not an actual syntax proposal. I'm just wondering about any prior
>> art.
>>
>> Bob
>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list