Andrey (azangru) wrote,
Andrey
azangru

In his mini-course Build Your Own RxJS Pipeable Operators, John Lindquist starts off by overriding an undocumented method in the Subscriber class:


class DoubleSubscriber extends Subscriber {
  _next(value) {
    console.log(value)
    this.destination.next(value * 2)
  }
}



(link)

No-one, without looking into the source code of RxJS, would even know that the Subscriber class has a _next method or a destination object. It is not in the public contract of the Subscriber class.

I wonder if it's a good practice to even touch the internals of a library, let alone build teaching materials that rely on this.
Subscribe

  • (no subject)

    com-petere со-ревновать-ся

  • (no subject)

    Someone is actually running a youtube ad campaign targeting React developers with a course on becoming a UI architect: The site that the ad…

  • (no subject)

    A beautiful cartoon on the front page of The Week:

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments