emadalam / atvjs

Blazing fast Apple TV application development using pure JavaScript
https://emadalam.github.io/atvjs
MIT License
311 stars 49 forks source link

reloadOnSelect not working #49

Closed hcheng2002cn closed 4 years ago

hcheng2002cn commented 5 years ago

I have a page which generated depend on the storage via page ready method: ready(options, resolve, reject) { var history = ATV.Settings.get('history'); ... }

and I set the option reloadOnSelect for this page in menu:

menu: { items: [{ id: 'home', name: 'My TV', page: HomePage, attributes: { autoHighlight: true, reloadOnSelect: true } }, }

While I update storage in other page and navigate back the home page, the page can not be updated. Looking to the debug console, the ready is not been called. So will reloadOnSelect invoke ready() to be called every time even the page already in the stack ? Anyway to update the content in the stack ? I have read you suggestion to use pubsub-js, any sample code for that ?

Thanks for help. hong

emadalam commented 5 years ago

Hi @hcheng2002cn

reloadOnSelect was not part of the main branch and was done as a POC. I just merged the PR from @MarhyCZ and released the new version on npm that has this included as part of the main branch. Can you try version 0.2.9 and let me know if you can achieve what you were trying to achieve 🙏