Module
Node.EventEmitter.TypedEmitter
- Package
- purescript-node-event-emitter
- Repository
- jordanmartinez/purescript-node-event-emitter
#TypedEmitter Source
newtype TypedEmitter :: Emittable -> Handlers -> Row Type -> Type
newtype TypedEmitter e h r
#asEmitterOnly Source
asEmitterOnly :: forall handler all. TypedEmitter CanEmit handler all -> TypedEmitter NoEmit handler all
#asHandlerOnly Source
asHandlerOnly :: forall emit all. TypedEmitter emit CanHandle all -> TypedEmitter emit NoHandle all
#setMaxListeners Source
setMaxListeners :: forall emit handler row. Int -> TypedEmitter emit handler row -> Effect Unit
#setUnlimitedListeners Source
setUnlimitedListeners :: forall emit handler row. TypedEmitter emit handler row -> Effect Unit
#listenersLength Source
listenersLength :: forall e h sym a tail row. Cons sym a tail row => IsSymbol sym => Proxy sym -> TypedEmitter e h row -> Effect Int
#on Source
on :: forall emit sym fn tail row effectFn. Cons sym fn tail row => UnsafeOnEvent fn effectFn => IsSymbol sym => Proxy sym -> fn -> TypedEmitter emit CanHandle row -> Effect effectFn
#addEventListener Source
addEventListener :: forall emit sym fn tail row effectFn. Cons sym fn tail row => UnsafeOnEvent fn effectFn => IsSymbol sym => Proxy sym -> fn -> TypedEmitter emit CanHandle row -> Effect effectFn
#off Source
off :: forall emit sym fn tail row effectFn. Cons sym fn tail row => HandlerFunction fn effectFn => UnsafeOffEvent effectFn => IsSymbol sym => Proxy sym -> effectFn -> TypedEmitter emit CanHandle row -> Effect Unit
#removeEventListener Source
removeEventListener :: forall emit sym fn tail row effectFn. Cons sym fn tail row => HandlerFunction fn effectFn => UnsafeOffEvent effectFn => IsSymbol sym => Proxy sym -> effectFn -> TypedEmitter emit CanHandle row -> Effect Unit
#subscribe Source
subscribe :: forall emit sym fn tail row effectFn. Cons sym fn tail row => UnsafeOnEvent fn effectFn => UnsafeOffEvent effectFn => IsSymbol sym => Proxy sym -> fn -> TypedEmitter emit CanHandle row -> Effect (Effect Unit)
#once Source
once :: forall emit sym fn tail row. Cons sym fn tail row => UnsafeOnceListener fn => IsSymbol sym => Proxy sym -> fn -> TypedEmitter emit CanHandle row -> Effect Unit
#emit Source
emit :: forall handler sym fn tail row argsThenEffectBoolean. Cons sym fn tail row => EmitterFunction fn argsThenEffectBoolean => UnsafeEmit argsThenEffectBoolean => IsSymbol sym => Proxy sym -> TypedEmitter CanEmit handler row -> argsThenEffectBoolean
Since the return type is polymorphic to allow one to
easily add as many arguments as are needed
using the same function,
type inference suffers. To workaround that
issue, precede all calls with withEmit
.
For example
b <- withEmit $ emit (Proxy :: _ "eventName") emitter arg1 arg2 arg3
void $ withEmit $ emit (Proxy :: _ "eventName") emitter arg1 arg2 arg3
Otherwise, you'll have to write this to deal with compiler errors:
(_ :: Boolean) <- emit (Proxy :: _ "eventName") emitter arg1 arg2 arg3
map (\(_ :: Boolean) -> unit) $ emit (Proxy :: _ "eventName") emitter arg1 arg2 arg3
#EmitterFunction Source
class EmitterFunction callbackFn emitterArgs | callbackFn -> emitterArgs
Determines the number and type of args to pass into the emit
function
based on the number and type of args received by the callback type
associated with that label in the row.
Instances
EmitterFunction (EffectFn10 a b c d e f g h i j Unit) (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Boolean)
EmitterFunction (EffectFn9 a b c d e f g h i Unit) (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Boolean)
EmitterFunction (EffectFn8 a b c d e f g h Unit) (a -> b -> c -> d -> e -> f -> g -> h -> Effect Boolean)
EmitterFunction (EffectFn7 a b c d e f g Unit) (a -> b -> c -> d -> e -> f -> g -> Effect Boolean)
EmitterFunction (EffectFn6 a b c d e f Unit) (a -> b -> c -> d -> e -> f -> Effect Boolean)
EmitterFunction (EffectFn5 a b c d e Unit) (a -> b -> c -> d -> e -> Effect Boolean)
EmitterFunction (EffectFn4 a b c d Unit) (a -> b -> c -> d -> Effect Boolean)
EmitterFunction (EffectFn3 a b c Unit) (a -> b -> c -> Effect Boolean)
EmitterFunction (EffectFn2 a b Unit) (a -> b -> Effect Boolean)
EmitterFunction (EffectFn1 a Unit) (a -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Unit) (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Unit) (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> e -> f -> g -> h -> Effect Unit) (a -> b -> c -> d -> e -> f -> g -> h -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> e -> f -> g -> Effect Unit) (a -> b -> c -> d -> e -> f -> g -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> e -> f -> Effect Unit) (a -> b -> c -> d -> e -> f -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> e -> Effect Unit) (a -> b -> c -> d -> e -> Effect Boolean)
EmitterFunction (a -> b -> c -> d -> Effect Unit) (a -> b -> c -> d -> Effect Boolean)
EmitterFunction (a -> b -> c -> Effect Unit) (a -> b -> c -> Effect Boolean)
EmitterFunction (a -> b -> Effect Unit) (a -> b -> Effect Boolean)
EmitterFunction (a -> Effect Unit) (a -> Effect Boolean)
EmitterFunction (Effect Unit) (Effect Boolean)
#HandlerFunction Source
class HandlerFunction callbackFn handlerFn | callbackFn -> handlerFn
Instances
HandlerFunction (EffectFn10 a b c d e f g h i j Unit) (EffectFn10 a b c d e f g h i j Unit)
HandlerFunction (EffectFn9 a b c d e f g h i Unit) (EffectFn9 a b c d e f g h i Unit)
HandlerFunction (EffectFn8 a b c d e f g h Unit) (EffectFn8 a b c d e f g h Unit)
HandlerFunction (EffectFn7 a b c d e f g Unit) (EffectFn7 a b c d e f g Unit)
HandlerFunction (EffectFn6 a b c d e f Unit) (EffectFn6 a b c d e f Unit)
HandlerFunction (EffectFn5 a b c d e Unit) (EffectFn5 a b c d e Unit)
HandlerFunction (EffectFn4 a b c d Unit) (EffectFn4 a b c d Unit)
HandlerFunction (EffectFn3 a b c Unit) (EffectFn3 a b c Unit)
HandlerFunction (EffectFn2 a b Unit) (EffectFn2 a b Unit)
HandlerFunction (EffectFn1 a Unit) (EffectFn1 a Unit)
HandlerFunction (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Boolean) (EffectFn10 a b c d e f g h i j Unit)
HandlerFunction (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Boolean) (EffectFn9 a b c d e f g h i Unit)
HandlerFunction (a -> b -> c -> d -> e -> f -> g -> h -> Effect Boolean) (EffectFn8 a b c d e f g h Unit)
HandlerFunction (a -> b -> c -> d -> e -> f -> g -> Effect Boolean) (EffectFn7 a b c d e f g Unit)
HandlerFunction (a -> b -> c -> d -> e -> f -> Effect Boolean) (EffectFn6 a b c d e f Unit)
HandlerFunction (a -> b -> c -> d -> e -> Effect Boolean) (EffectFn5 a b c d e Unit)
HandlerFunction (a -> b -> c -> d -> Effect Boolean) (EffectFn4 a b c d Unit)
HandlerFunction (a -> b -> c -> Effect Boolean) (EffectFn3 a b c Unit)
HandlerFunction (a -> b -> Effect Boolean) (EffectFn2 a b Unit)
HandlerFunction (a -> Effect Boolean) (EffectFn1 a Unit)
HandlerFunction (Effect Unit) (Effect Unit)
Re-exports from Node.EventEmitter
#UnsafeEmit Source
class UnsafeEmit a
Instances
UnsafeEmit (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Boolean)
UnsafeEmit (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Boolean)
UnsafeEmit (a -> b -> c -> d -> e -> f -> g -> h -> Effect Boolean)
UnsafeEmit (a -> b -> c -> d -> e -> f -> g -> Effect Boolean)
UnsafeEmit (a -> b -> c -> d -> e -> f -> Effect Boolean)
UnsafeEmit (a -> b -> c -> d -> e -> Effect Boolean)
UnsafeEmit (a -> b -> c -> d -> Effect Boolean)
UnsafeEmit (a -> b -> c -> Effect Boolean)
UnsafeEmit (a -> b -> Effect Boolean)
UnsafeEmit (a -> Effect Boolean)
UnsafeEmit (Effect Boolean)
#UnsafeOffEvent Source
class UnsafeOffEvent callbackFn
Instances
UnsafeOffEvent (EffectFn10 a b c d e f g h i j Unit)
UnsafeOffEvent (EffectFn9 a b c d e f g h i Unit)
UnsafeOffEvent (EffectFn8 a b c d e f g h Unit)
UnsafeOffEvent (EffectFn7 a b c d e f g Unit)
UnsafeOffEvent (EffectFn6 a b c d e f Unit)
UnsafeOffEvent (EffectFn5 a b c d e Unit)
UnsafeOffEvent (EffectFn4 a b c d Unit)
UnsafeOffEvent (EffectFn3 a b c Unit)
UnsafeOffEvent (EffectFn2 a b Unit)
UnsafeOffEvent (EffectFn1 a Unit)
UnsafeOffEvent (Effect Unit)
#UnsafeOnEvent Source
class UnsafeOnEvent callbackFn callbackEffectFn | callbackFn -> callbackEffectFn
Instances
UnsafeOnEvent (EffectFn10 a b c d e f g h i j Unit) (EffectFn10 a b c d e f g h i j Unit)
UnsafeOnEvent (EffectFn9 a b c d e f g h i Unit) (EffectFn9 a b c d e f g h i Unit)
UnsafeOnEvent (EffectFn8 a b c d e f g h Unit) (EffectFn8 a b c d e f g h Unit)
UnsafeOnEvent (EffectFn7 a b c d e f g Unit) (EffectFn7 a b c d e f g Unit)
UnsafeOnEvent (EffectFn6 a b c d e f Unit) (EffectFn6 a b c d e f Unit)
UnsafeOnEvent (EffectFn5 a b c d e Unit) (EffectFn5 a b c d e Unit)
UnsafeOnEvent (EffectFn4 a b c d Unit) (EffectFn4 a b c d Unit)
UnsafeOnEvent (EffectFn3 a b c Unit) (EffectFn3 a b c Unit)
UnsafeOnEvent (EffectFn2 a b Unit) (EffectFn2 a b Unit)
UnsafeOnEvent (EffectFn1 a Unit) (EffectFn1 a Unit)
UnsafeOnEvent (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Unit) (EffectFn10 a b c d e f g h i j Unit)
UnsafeOnEvent (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Unit) (EffectFn9 a b c d e f g h i Unit)
UnsafeOnEvent (a -> b -> c -> d -> e -> f -> g -> h -> Effect Unit) (EffectFn8 a b c d e f g h Unit)
UnsafeOnEvent (a -> b -> c -> d -> e -> f -> g -> Effect Unit) (EffectFn7 a b c d e f g Unit)
UnsafeOnEvent (a -> b -> c -> d -> e -> f -> Effect Unit) (EffectFn6 a b c d e f Unit)
UnsafeOnEvent (a -> b -> c -> d -> e -> Effect Unit) (EffectFn5 a b c d e Unit)
UnsafeOnEvent (a -> b -> c -> d -> Effect Unit) (EffectFn4 a b c d Unit)
UnsafeOnEvent (a -> b -> c -> Effect Unit) (EffectFn3 a b c Unit)
UnsafeOnEvent (a -> b -> Effect Unit) (EffectFn2 a b Unit)
UnsafeOnEvent (a -> Effect Unit) (EffectFn1 a Unit)
UnsafeOnEvent (Effect Unit) (Effect Unit)
#UnsafeOnceListener Source
class UnsafeOnceListener callbackFn
Instances
UnsafeOnceListener (EffectFn10 a b c d e f g h i j Unit)
UnsafeOnceListener (EffectFn9 a b c d e f g h i Unit)
UnsafeOnceListener (EffectFn8 a b c d e f g h Unit)
UnsafeOnceListener (EffectFn7 a b c d e f g Unit)
UnsafeOnceListener (EffectFn6 a b c d e f Unit)
UnsafeOnceListener (EffectFn5 a b c d e Unit)
UnsafeOnceListener (EffectFn4 a b c d Unit)
UnsafeOnceListener (EffectFn3 a b c Unit)
UnsafeOnceListener (EffectFn2 a b Unit)
UnsafeOnceListener (EffectFn1 a Unit)
UnsafeOnceListener (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> d -> e -> f -> g -> h -> i -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> d -> e -> f -> g -> h -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> d -> e -> f -> g -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> d -> e -> f -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> d -> e -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> d -> Effect Unit)
UnsafeOnceListener (a -> b -> c -> Effect Unit)
UnsafeOnceListener (a -> b -> Effect Unit)
UnsafeOnceListener (a -> Effect Unit)
UnsafeOnceListener (Effect Unit)