paritytech / capi

[WIP] A framework for crafting interactions with Substrate chains
https://docs.capi.dev
Apache License 2.0
104 stars 10 forks source link

`Rune.de` #680

Open harrysolovay opened 1 year ago

harrysolovay commented 1 year ago

A utility to simplify destructuring runes from runes.

const abc = Rune.tuple([a, b, c])
const [a, b, c] = Rune.de(abc)

const xyz = Rune.rec({ a, b, c })
const { x, y, z } = Rune.de(xyz)
tjjfvi commented 1 year ago

It should probably be called something else (perhaps Rune.destructure or Rune.access, but this does seem like a nice utility.