I'm working on my first FLUX app and stumbled upon this problem. I want to get data from the server and pass it down to my component.
Say i have a component method ...
loadMore() {
AppActions.getCards();
}
... and a store:
$.ajax({
url: '../data.json',
dataType: "json",
success: function (data) {
// ???
}.bind(this),
error: function (xhr, status, err) {
console.error(status, err.toString());
}.bind(this)
});
not quite sure how to do it properly.
inside the ajax this
is obviously undefined
, also can't return value from it, or can i?
pretty sure it's trivial, but would be really grateful for an advice