So the documentation says https://www.fusetools.com/learn/fusejs#storage-read-read and it’s working fine, the console prints out the content. But, it seems that i can’t get the content out of this function.
Just a basic example:
var test = Observable({'foo': 'bar'}); //start with one element
storage.write('foobar', 'something'); //write something into file
storage.read('foobar').then(function(content) { //read out something
test.add({'foo2': content}); //add something as second element
});
console.log(test.length); //count elements
I expected this to return 2 cause i start with one element, then add another one and should end up with 2, but it always prints out 1. That can only mean, that test is not available or can’t be modified inside the storage.read()
function for some reason.
Is there any chance to read a file and work with the content outside of the storage.read()
function?