What is wrong with this picture… I have a module that manages the content fetched from an API. I would like the UX to be updated whenever the content is fetched and the content observable updated with the new content. My problem is that every time I fetch the content, and the content is passed into the content observable, the UX doesnt get updated with the values. Each is allways empty.
MyModule.js
var Observable = require('FuseJS/Observable');
var content = new Observable();
function fetchContent(){
//...fetch something then set the content into content using content.replaceAll(items)....
}
module.exports = {
content: content,
fetchContent: fetchContent,
}
myUx.ux
<JavaScript>
var myModule = require('MyModule')
myModule.fetchContent();
module.exports = {
contentFromModule : myModule.content,
}
</JavaScript>
...
<Each Items="{contentFromModule}">
<!-- Do something with each item -->
</Each>
...