fp-ts-std icon indicating copy to clipboard operation
fp-ts-std copied to clipboard

getClassNames

Open samhh opened this issue 3 years ago • 1 comments

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)),
)

samhh avatar Oct 18 '22 11:10 samhh

What about an IORef?

samhh avatar Oct 19 '22 15:10 samhh