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)

    (retweeted by a developer) How does she interpret what she has highlighted — "unlawful blocking of a public street" — as "pedestrians whose…

  • (no subject)

    Google has finally become ready to promote its Lit ecosystem properly. I thought they were going make their announcements at the coming Google IO;…

  • (no subject)

    Is it ... Bill Maher? Is he, in the penetrating eyes of this insightful lady, the emblem of white supremacy now? The comments to the tweet say it…

  • 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