Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getClassNames #149

Open
samhh opened this issue Oct 18, 2022 · 1 comment
Open

getClassNames #149

samhh opened this issue Oct 18, 2022 · 1 comment

Comments

@samhh
Copy link
Owner

samhh commented Oct 18, 2022

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
Copy link
Owner Author

samhh commented Oct 19, 2022

What about an IORef?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant