Closed jerbaroo closed 8 months ago
onDidMount
is in the Pursuit documentation, but does need seem to be in the create-deku-app
-generated project.
The answer was to use Self
.
The Pursuit documentation and the README is out of date (as they both mention Deku.Lifecycle which is a solution in an old version of Deku).
myMap :: Nut
myMap = Deku.do
setLocation /\ location <- useState initialLocation
D.div
[ DA.id_ "map-row"
, Self.self_ \_ -> liftEffect $ runEffectFn2
initLeaflet allLocations setLocation
]
[ D.div [ DA.id_ "map-container" ] []
, location <#~> locationInfo
]
You can see in the example below what I am trying to accomplish, in short:
setLocation
function viauseState
initMap
which will attach to the Deku-generated DOMsetLocation
toinitMap
, so that when locations on the map are clicked the Purescript can be informed