Skip to content

Commit

Permalink
onChangeViewport -> onViewportChange
Browse files Browse the repository at this point in the history
  • Loading branch information
safareli committed May 9, 2018
1 parent 3c15b93 commit c3ddad7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/map-halogen/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ui =
pure next
eval (HandleMapUpdate msg next) = do
case msg of
OnChangeViewport vp -> liftEff $ log $ show vp
OnViewportChange vp -> liftEff $ log $ show vp
OnClick info -> liftEff $ log $ show info.lngLat
pure next

Expand Down
6 changes: 3 additions & 3 deletions example/map-halogen/src/MapComponent.purs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ data MapQuery a
| HandleMessages Messages a

data MapMessages
= OnChangeViewport Viewport
= OnViewportChange Viewport
| OnClick ClickInfo

mapComponent :: forall eff m. MonadAff (dom :: DOM, avar :: AVAR | eff) m => H.Component HH.HTML MapQuery MapProps MapMessages m
Expand Down Expand Up @@ -154,8 +154,8 @@ mapClass = R.createClass spec
pure
$ R.createFactory MapGL.mapGL
$ MapGL.mkProps viewport
{ onChangeViewport: mkEffFn1 $ \newVp -> do
launchAff_ $ Bus.write (PublicMsg $ OnChangeViewport newVp) messages
{ onViewportChange: mkEffFn1 $ \newVp -> do
launchAff_ $ Bus.write (PublicMsg $ OnViewportChange newVp) messages
void $ R.transformState this _{viewport = newVp}
, onClick: mkEffFn1 $ \info -> do
launchAff_ $ Bus.write (PublicMsg $ OnClick info) messages
Expand Down
2 changes: 1 addition & 1 deletion example/map/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mapSpec = R.spec' (const initialViewport) render
render this = R.readState this <#> \vp ->
R.createFactory MapGL.mapGL $
MapGL.mkProps vp
{ onChangeViewport: mkEffFn1 $ \newVp -> do
{ onViewportChange: mkEffFn1 $ \newVp -> do
log $ "Changed Viewport: " <> show newVp
void $ R.writeState this newVp
, onClick: mkEffFn1 $ \info -> do
Expand Down
6 changes: 3 additions & 3 deletions src/MapGL.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module MapGL
( Viewport(..)
, ViewportR
, LngLat
, OnChangeViewport
, OnViewportChange
, ClickInfo
, OnClickMap
, MapProps
Expand Down Expand Up @@ -70,7 +70,7 @@ instance showLngLat :: Show LngLat where
show = genericShow

-- | A handler to be run whenever the viewport changes
type OnChangeViewport eff = EffFn1 eff Viewport Unit
type OnViewportChange eff = EffFn1 eff Viewport Unit

-- | The type exposed by the picking engine (abbreviated).
-- | - `latLng`: The latitude and longitude of the point picked.
Expand All @@ -82,7 +82,7 @@ type ClickInfo =
type OnClickMap eff = EffFn1 eff ClickInfo Unit

type MapPropsR eff r =
( onChangeViewport :: OnChangeViewport eff
( onViewportChange :: OnViewportChange eff
, onClick :: OnClickMap eff
, mapStyle :: String
, mapboxApiAccessToken :: String
Expand Down

0 comments on commit c3ddad7

Please sign in to comment.