fp-ts-std
fp-ts-std copied to clipboard
getClassNames
For DOM. Roughly:
const getClassNameAttr = (x: Element): IO<string> => () => x.className
export const getClassNames: (x: Element) => IO<Array<string>> = flow(
getClassNameAttr,
IO.map(flow(Str.words, A.fromReadonly)),
)
What about an IORef?