Skip to content

Conversation

Ombuweb
Copy link
Contributor

@Ombuweb Ombuweb commented Nov 20, 2022

…es Android

@cla-bot cla-bot bot added the cla: yes label Nov 20, 2022
@vallemar
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor

@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 NathanWalker changed the base branch from main to dev September 2, 2023 18:35
@NathanWalker
Copy link
Contributor

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

@NathanWalker NathanWalker merged commit fddbbd3 into NativeScript:dev Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants