object CallbackHelpers
Some small support to convert callback APIs in node to a cats effect. This
is similar in spirit to io.scalajs.util.PromiseHelper. The first parameter is
almost always a subtype of js.Error
. Most of these methods check the value
of the first parameter and if null or undefined, return a failed effect. The
function argument is usually a curried function call from a javascript
facade.
- Alphabetic
- By Inheritance
- CallbackHelpers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withError0[F[_], Z](f: (Function1[Z, Any]) ⇒ Unit)(implicit F: Async[F]): F[Unit]
Pass in the function that you only care about the error handler value.
Pass in the function that you only care about the error handler value. The 0 means that there are no arguments after the implied "error" first argument.
- Z
Error type, typically js.Error.
- Annotations
- @inline()
-
def
withError1[F[_], Z, A](f: (Function2[Z, A, Any]) ⇒ Unit)(implicit F: Async[F]): F[A]
Pass in the function that you only care about the error handler value and the value.
Pass in the function that you only care about the error handler value and the value. The signature javascript callback signatre is usually
(err, value)
. Use currying on the scala facade e.g.someFacadeFunc(arg1, (err, value) => ...)
becomeswithError1[IO,js.Error,Int](someFacadeFunc(arg1, _))
..- Z
Error type, typically js.Error.
- A
The value type.
- Annotations
- @inline()