Show HN: Ts-Chan – Go-Like Concurrency Primitives for TypeScript/JavaScript

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • ts-chan

    Concurrency primitives for TypeScript and JavaScript.

  • Generators have lots of really nice uses, yep.

    I'm not sure what specifically you were imagining, but I've added an example of how "vanilla JS" can achieve fan-in, using an AsyncGenerator: https://github.com/joeycumines/ts-chan/blob/main/docs/patter...

    It uses one of the patterns suggested in a comment chain above, which I think is pretty neat, and wasn't one that readily occurred to me: https://news.ycombinator.com/item?id=38163562

    I'm not making a case for using ts-chan for any situation where a simple generator-based solution suffices. I wouldn't call the example solution (in my first link) simple, but it's something I'd personally be ok with maintaining. Like, I'd approve a PR containing something similar without significant qualms, _if_ there was a significant enough motivator, and it was sufficiently unit tested. I might suggest that as an alternative, to make it easier to maintain, but wouldn't be particularly concerned either way.

    That's all very subjective, though :)

  • channel

    Discontinued Go-like channels for JavaScript (by NodeGuy)

  • I think I prefer its more concise API, e.g. [for select](https://github.com/NodeGuy/channel/blob/main/API.md#examples). ts-chan's API looks a bit too verbose to my taste.

    Here's an example from ts-chan:

    ```

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • contextlib

    JS implementation of python's context managers. With 💙 { ... }

  • If you want it to run on exiting the function in reverse order, something like Python's context managers would probably be necessary.

    I've dabbled in that too, though I don't actually use it for anything, currently: https://github.com/Mcsavvy/contextlib/pull/1

  • generator-ticker

    An ES6 generator similar to setInterval that adjusts for slow receivers.

  • Actually, it was fun, so I've made it into an actual package.

    The one I slapped together works, but this one is better (fixes issues with actually stopping it properly): https://github.com/joeycumines/generator-ticker

    On NPM as generator-ticker.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Hyperbridge: Fast multi-producer, multi-consumer unbounded channel in Rust

    4 projects | news.ycombinator.com | 9 Feb 2024
  • Loole, A safe sync/async multi-producer, multi-consumer channel, Boosted Async Performance Up to 17%

    1 project | /r/rust | 1 Dec 2023
  • Reconnecting with Scala. What's new?

    7 projects | /r/scala | 24 May 2023
  • Concurrent.js

    4 projects | /r/node | 20 Feb 2023
  • Any C++ open source projects for beginners?

    3 projects | /r/cpp | 16 Jan 2023