d3dc / babel-preset-techno-babel

A babel preset that adds stable future js operators for terse functional programming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

babel-preset-techno-babel

babel needs more babble.

New operators

  • |> - pipeline

    • compose function calls left to right instead of right to left
    • array |> sortBy(_.name) |> partitionBy(_.age)
  • ?? - nullish coalescing

    • stricter maybe || 'default'
    • maybe ?? 'default'
  • ?. - optional chaining

    • only access properties if the receiver is defined
    • user?.address?.state

Logical assignment operators

  • ||=
  • &&=
  • ??=

New blocks

  • do
    • evaluates a block as an expressions
    • keeps your scopes isolated - let statements don't leak

Misc

  • export default from
    • export Footer from './Footer'
  • numeric literal separator
    • 9_000_000

About

A babel preset that adds stable future js operators for terse functional programming


Languages

Language:JavaScript 100.0%