6 ms·
This looks really cool! Do you currently have any abstractions for interacting with DOM elements?
by jp_rider 12y ago
This looks really cool! Do you currently have any abstractions for interacting with DOM elements?
- alex_berg 12y agoI'm only a bystander, but I believe PureScript doesn't include data-to-DOM binding. If you want to do it manually, I would look at the Eff monad[1]. It sounds like there are adapters to few popular frameworks, like React [2] and Angular [3]. [1] https://leanpub.com/purescript/read#leanpub-auto-the-eff-monad https://leanpub.com/purescript/read#leanpub-auto-the-eff-mon... [2] https://github.com/purescript-contrib/purescript-react https://github.com/purescript-contrib/purescript-react [3] https://github.com/purescript-contrib/purescript-angular https://github.com/purescript-contrib/purescript-angular I'm guessing a JS-controlled framework, like React or Mithril, would be a better fit if you choose to use PureScript as a core piece of your app, as they are function-based, like PureScript.
- jp_rider 12y agoInteresting. For my current project, I don't want to include large frameworks so it looks like this library [1] should do the trick. [1] https://github.com/aktowns/purescript-simple-dom https://github.com/aktowns/purescript-simple-dom
- paf31 12y agoThere are a few options, but the most fully-formed is probably purescript-react. I'm also interested to see where the virtual-dom bindings go. The last chapter of the book covers how you might go about writing a library for working with DOM elements in PureScript.