Packages

o

dynamics.common

CallbackHelpers

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CallbackHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  20. 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()
  21. 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) => ...) becomes withError1[IO,js.Error,Int](someFacadeFunc(arg1, _))..

    Z

    Error type, typically js.Error.

    A

    The value type.

    Annotations
    @inline()

Inherited from AnyRef

Inherited from Any

Ungrouped