Hologram v0.8.0: Elixir Gets JavaScript Interop

I’m sure y’all considered this as part of the design but I can’t help but think how clean it’d be to drop the brackets and create the list as an implementation detail under the hood.

So this

result =
  :Decimal
  |> JS.new([100])
  |> JS.call(:plus, [23])
  |> JS.call(:toNumber, [])  

becomes

result =
  :Decimal
  |> JS.new(100)
  |> JS.call(:plus, 23)
  |> JS.call(:toNumber)  
2 Likes