@flect/traverse
v3.0.0
Published
Data traversal for flect types
Downloads
7
Maintainers
Readme
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'