Skip to content

Instantly share code, notes, and snippets.

View johnflux's full-sized avatar

John Tapsell johnflux

View GitHub Profile
class FetchRest {
....
putValue(name, value) {
// Set value via REST as well as updating the state
var newParameters = {...this.component.state.api, [parameterName] : value};
this.component.setState({api: newParameters});
fetch( this.restServerUrl + '/api/' + name,
{
method: 'PUT',