3.0.0 • Published 6 months ago
@flect/traverse v3.0.0
Introduction
Flect/traverse is a library for building traversals for Flect types.
Usage
const Animal = record({
legCount: numberType,
sound: stringType
});
type Animal = Reify<typeof Animal>;
const getSound = traverseRecord(Animal, "sound");
const myDog = {legCount: 4, sound: "woof"};
console.log(getSound(myDog)); // Goes 'woof'