I’m trying to make a table sortable. There’s this popular library. It may work without PureScript code, but in my case the table is created dynamically, so I need to call makeSortable
over the table via FFI.
Now, I am not sure how to call any Effect
over the table as it gets created. The code obviously has to be encapsulated inside a “table” component. So, like, I’d have this:
tableSortable :: Array JSX -> React.Component Unit
tableSortable children =
React.component "tableSortable" \_ -> React.do
pure $ R.table_ children
and somewhere inside I need to either call makeSortable
or hook it up to an event. I presume, the HTML doesn’t exist till the pure $ …
part was executed, which implies makeSortable
has to be hooked up to an event.
I looked up if there’s some onRender
or onLoad
, but I don’t see any, so I am not sure how to implement this.