Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
That Equals This?
handleRefreshData(paramOne, paramTwo, oldState) {
var that = this;
var httpRequest = new XMLHttpRequest();
var httpRequestURL = "";"POST", httpRequestURL, true);
httpRequest.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Get Response Data
var data = this.responseText;
data = JSON.parse(data);
// Update State With Fresh Financial Data HERE
var newState = oldState; =; =;
newState.baz = data.baz;
that.setState(newState); // update state with fresh financial data
var formData = new FormData();
formData.append("abc", paramOne);
formData.append("xyz", paramTwo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.