- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm looking for clarification on what the difference is between observeField and observeFieldScoped on ifSGNodeField. The documentation (https://developer.roku.com/en-gb/docs/references/brightscript/interfaces/ifsgnodefield.md#observefie...) doesn't seem to describe the difference, as the callback for both is expected to be in the receiving component. In my testing, they both worked like this, seemingly identically. Does anyone know?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I understand it, the difference is when we come to unobserve.
If we observeFieldScoped then unobserveFieldScoped we won't remove other observers (i.e. from another component) - but if we observeField then unobserveField we'll clear out every other observer too.
I tend to use the 'scoped' versions everywhere.
Watching this thread in case I'm wrong, that'd be good to know!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I understand it, the difference is when we come to unobserve.
If we observeFieldScoped then unobserveFieldScoped we won't remove other observers (i.e. from another component) - but if we observeField then unobserveField we'll clear out every other observer too.
I tend to use the 'scoped' versions everywhere.
Watching this thread in case I'm wrong, that'd be good to know!