Using the Switch(true) Pattern in JavaScript

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

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
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • proposal-pattern-matching

    Pattern matching syntax for ECMAScript

  • Hopefully we will get real pattern-matching at some point (https://github.com/tc39/proposal-pattern-matching), but I kinda sorta like this!

  • io-ts

    Runtime type system for IO decoding/encoding

  • Sure, if you're validating some data there're loads of better ways to do it than a bunch of conditionals. I was purely commenting on the switch(true) pattern vs some "if"s.

    That approach looks nice though. On that subject, JS has some nice libraries including io-ts[1] which has a functional approach using Eithers to encapsulate errors/success.

    [1]: https://github.com/gcanti/io-ts

  • 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.

    InfluxDB logo
  • ecma262

    Status, process, and documents for ECMA-262

  • I've never considered writing a proposal for a language feature before, but after 2 minutes of googling, this actually looks completely doable:

    https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md

    So, impostor syndrome aside, why not? Wanna team up on that?

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

  • TypeScript with GraphQL done right 🏗

    2 projects | /r/graphql | 20 Apr 2021
  • Strongly-typed GraphQL without code generation?

    2 projects | /r/reactjs | 6 Apr 2021
  • [DDD] Tactical Design Patterns Part 3: Presentation/Infrastructure Layer

    4 projects | dev.to | 16 Jan 2024
  • TDD

    2 projects | /r/CharruaDevs | 7 Dec 2023
  • PURISTA - Thanks to amazing open-source software

    7 projects | dev.to | 11 Sep 2023