Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetchData = async (dataURL, dictionaryURL) => {
- let joinedData;
- await fetch(dataURL)
- .then(results => results.json())
- .then(data => {
- joinedData = data;
- joinedData.forEach(element => {
- if (this.state.statusDictionary[element.status] !== undefined)
- element.status = this.state.statusDictionary[element.status];
- else element.status = 'N/A';
- if (this.state.osDictionary[element.os] !== undefined)
- element.os = this.state.osDictionary[element.os];
- else element.os = 'N/A';
- });
- });
- this.setState({ tableData: joinedData });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement