Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Rename ObserverLike to SinkLike
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Jacobowitz committed Mar 7, 2017
1 parent fa55415 commit ecaf7f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/Sink.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import RxJS.Observable (Observable)

newtype Observer e a = Observer (a -> Eff e Unit)

type ObserverLike e a r = { sink :: Observer e a | r }
type SinkLike e a r = { sink :: Observer e a | r }

type Handler eff a =
{ src :: Observable a
Expand All @@ -30,19 +30,19 @@ createSink :: forall a e. (a -> Eff e Unit) -> Sink e a
createSink fn = { sink : Observer fn }


foreign import redirect :: forall a b e r. ObserverLike e a r -> (Observable b -> Observable a) -> Sink e b
foreign import redirect :: forall a b e r. SinkLike e a r -> (Observable b -> Observable a) -> Sink e b

foreign import redirect2Impl :: forall a b c e r. ObserverLike e a r -> (Observable b -> Observable c -> Observable a)
foreign import redirect2Impl :: forall a b c e r. SinkLike e a r -> (Observable b -> Observable c -> Observable a)
-> (b -> c -> Tuple b c) -> Tuple (Sink e b) (Sink e c)

foreign import redirect3Impl :: forall a b c d e r. ObserverLike e a r -> (Observable b -> Observable c -> Observable d -> Observable a)
foreign import redirect3Impl :: forall a b c d e r. SinkLike e a r -> (Observable b -> Observable c -> Observable d -> Observable a)
-> (a -> a -> a -> Tuple3 a a a) -> Tuple3 (Sink e b) (Sink e c) (Sink e d)

redirect2 :: forall a b c e r. ObserverLike e a r -> (Observable b -> Observable c -> Observable a) -> Tuple (Sink e b) (Sink e c)
redirect2 :: forall a b c e r. SinkLike e a r -> (Observable b -> Observable c -> Observable a) -> Tuple (Sink e b) (Sink e c)
redirect2 observerLike project = redirect2Impl observerLike project Tuple

redirect3 :: forall a b c d e r. ObserverLike e a r -> (Observable b -> Observable c -> Observable d -> Observable a) -> Tuple3 (Sink e b) (Sink e c) (Sink e d)
redirect3 :: forall a b c d e r. SinkLike e a r -> (Observable b -> Observable c -> Observable d -> Observable a) -> Tuple3 (Sink e b) (Sink e c) (Sink e d)
redirect3 observerLike project = redirect3Impl observerLike project tuple3

redirectMap :: forall a b e r. ObserverLike e a r -> (b -> a) -> Sink e b
redirectMap :: forall a b e r. SinkLike e a r -> (b -> a) -> Sink e b
redirectMap observer project = { sink : (cmap project observer.sink) }
4 changes: 2 additions & 2 deletions src/dom/EmitterBuilder.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import DOM.HTML.Event.Types (DragEvent)
import DOM.Node.Types (Element)
import Data.Tuple (Tuple)
import Data.Unit (Unit)
import OutWatch.Sink (Observer, ObserverLike, redirect, redirectMap)
import OutWatch.Sink (Observer, SinkLike, redirect, redirectMap)
import RxJS.Observable (Observable, withLatestFrom)
import VDomModifier (Emitter(..), Property(..), VDom(..))

Expand Down Expand Up @@ -98,7 +98,7 @@ instance mappableBoolBuilder :: MappableBuilder BoolEmitterBuilder a Boolean e w


class EmitterBuilder builder a eff | builder -> eff, builder -> a where
emitFrom :: forall r. builder -> ObserverLike eff a r -> VDom eff
emitFrom :: forall r. builder -> SinkLike eff a r -> VDom eff

instance genericEmitterBuilder :: EmitterBuilder (GenericMappedEmitterBuilder a b e) a e where
emitFrom (GenericMappedEmitterBuilder { constructor , mapping }) {sink} =
Expand Down

0 comments on commit ecaf7f2

Please sign in to comment.