Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
abrykajlo committed Mar 13, 2016
1 parent dbc4a22 commit aa67ef9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# elm-scroll
An Elm Library for scrolling through a page
An Elm Library for scrolling through a page and handling event triggers

## Warning

This library is incomplete and not working currently. I believe it will be up and running and useable
in the next week or so.
22 changes: 5 additions & 17 deletions src/Scroll.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Scroll
( scrollY
, Direction(Up, Down), (=>)
, Event(Update,Trigger)
, triggerEvents, ScrollEvent, Transition, Boundary
, eventsTrigger, Transition, Boundary
)
where

Expand Down Expand Up @@ -91,29 +91,17 @@ eventsTrigger list transition =
(newModel, Effects.batch fx)


eventTriggerFilter : Transition -> ScrollEvent m a -> Maybe (Event m a)
eventTriggerFilter (from, to) (line, direction, event) =
let
crossed =
cross line from to
in
if crossed && dir == direction then
Just event
else
Nothing


triggerEffectFilter : Event m a -> Maybe (Effects a)
triggerEffectFilter event =
triggerFilter : Event m a -> Maybe (Effects a)
triggerFilter event =
case event of
Trigger effect ->
Just effect
_ ->
Nothing


triggerUpdateFilter : Event m a -> Maybe (m -> m)
triggerUpdateFilter event =
updateFilter : Event m a -> Maybe (m -> m)
updateFilter event =
case event of
Update update ->
Just update
Expand Down

0 comments on commit aa67ef9

Please sign in to comment.