From b4d168a86bdedde6334e8f99fbda8513bb529d10 Mon Sep 17 00:00:00 2001 From: rl-king Date: Mon, 5 Nov 2018 13:04:54 +0100 Subject: [PATCH] Update readme --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c26f79..e99eb1c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Detect if an element is in the current viewport [example live](https://rl-king.github.io/elm-inview-example/) | [example code](https://github.com/rl-king/elm-inview-example) - + Since there is currently no way of listening to scroll events in Elm you'll have to hookup a port. Below is the bit of JS that gets you the scroll position and an example on how to set it all up. @@ -54,7 +54,11 @@ update msg model = ) InViewMsg inViewMsg -> - ( { model | inView = InView.update inViewMsg model.inView } - , Cmd.none + let + ( inView, inViewCmds ) = + InView.update inViewMsg model.inView + in + ( { model | inView = inView } + , Cmd.map InViewMsg inViewCmds ) ```