var Observable = require('FuseJS/Observable');
var token = Observable("");
var frnd = Observable();
var url;
this.Parameter.onValueChanged(function(args) {
token.value = args;
});
url = "https://api.vk.com/method/friends.get?";
url += "access_token=" + token.value + "&fields=photo_200&order=hints";
fetch(url)
.then(function(res) {
return res.json();
})
.then(function(resJson) {
frnd.value = resJson;
console.log("frnd 1 is " + JSON.stringify(frnd.value))
})
.catch(function(err) {
console.log("ero: " + err);
})
console.log("frnd 2 is " + JSON.stringify(frnd.value));
now look log:
LOG: frnd 2 is undefined
LOG: frnd 1 is {"response":[{"uid":298682753,"first_name":...next_info.....