Uneventful
    Preparing search index...
    • Bind a this to a function, with stricter typing than .bind()

      In Uneventful, this is mainly used to turn generator functions into simulated arrow functions.

      Note: If your generator also needs to access the task's Work, be sure to declare its type (e.g. boundTo(this, function*(self: Work<whatever>) {...})), even if you're using start<whatever>(), as TypeScript will interpret an untyped argument in your function signature as never.

      Type Parameters

      • This
      • F extends (this: This, ...args: never) => unknown

      Parameters

      • thisArg: This

        The this the function will be bound to

      • fn: F

        A function accepting thisArg's type as its this

      Returns OmitThis<F>

      a bound function