(callback, api='topic')
| 17 | // Fetch and call the callback function after the response |
| 18 | // is converted to returned and converted to json |
| 19 | function fetchTopics(callback, api='topic') { |
| 20 | fetch(`http://${clientConfig.host}:${clientConfig.port}/${api}`) |
| 21 | .then(res => res.json()) |
| 22 | .then(json => callback(json)); |
| 23 | }; |
| 24 | |
| 25 | |
| 26 | /* |