NativeScript / docs

The NativeScript Docs!
https://docs.nativescript.org/
12 stars 23 forks source link

docs: initial content for Extending Classes and Implementing Interfac… #28

Closed Ombuweb closed 1 year ago

Ombuweb commented 1 year ago

…es Android

vallemar commented 1 year ago

Why do this https://github.com/NativeScript/docs/pull/28/files#diff-70925e72212c56f9d0c078f75198908a4309d0f96c256a086bfdb8d9f9e16b20R525 instead of just doing this? new ClickListenerImpl(), and by the same token, why is this initializeClickListener() necessary?

If it is necessary to do this I think it would be worth mentioning

rigor789 commented 1 year ago

I believe we can refactor that to not use the initialize function. The main reason that was documented that way in the old docs was because of snapshots, they needed all native code to be deferred/not ran during snapshots only during runtime, so many parts of core still follow that pattern, but it is no longer necessary or recommended, since snapshot support has been deprecated/dropped in NS7.

vallemar commented 1 year ago

@rigor789 Perfect, I said it because it seems like a black magic that was not explained. If it is no longer needed much better since it is finally less to understand for the developer, create your class, instantiate it and working

NathanWalker commented 1 year ago

Thanks or mention @vallemar I switched docs examples to not use the function closures since snapshots are not used.