Answer the question
In order to leave comments, you need to log in
Is it possible to get initialState from DOM when using Flux?
I am using flux.utils . You need to get a CSRF token for the form. It comes to me from the server and goes
into the meta tag. The question is, is it correct to get it when initializing `Store`, something like this:
class SomethingStore extends ReduceStore {
constructor() {
super(Dispatcher);
}
getInitialState() {
return Map({
value: '',
csrf: document.querySelector("meta[name=csrf-token]").content,
});
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question