docs-v7 icon indicating copy to clipboard operation
docs-v7 copied to clipboard

Wrong example for addWeakEventListener

Open smelukov opened this issue 6 years ago • 1 comments

Please, tell us what's the problem?

Wrong documentation

Please, tell us more details

Hi! I found a super weird example in the docs https://docs.nativescript.org/core-concepts/events#working-with-weak-events-Adding

  • this uses in global scope (it's undefined)
  • addWeakEventListener has a totally different definition: addWeakEventListener(source: Observable, eventName: string, handler: (eventData: EventData) => void, target: any): void;
  • no WeakRef import
  • there are no WeakEventListener and WeakEventListenerOptions exports in the tns-core-modules/ui/core/weak-event-listener-module
  • and other mistakes...

smelukov avatar Aug 07 '18 21:08 smelukov

Thanks for point this out @smelukov. We will take a look at the issue. Meanwhile, if you have a suggestion how to make this example work - you are most welcome to open a pull request in this repository.

etabakov avatar Aug 10 '18 11:08 etabakov