Created
August 17, 2016 04:35
-
-
Save johnflux/c22667573a66d642361a8778822bb454 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | |
headers: this.header, | |
body: JSON.stringify(value) | |
}); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleReset() { | |
this.context.apiCallbacks.putValue("gamma", {r:1,g:1,b:1}); | |
this.context.apiCallbacks.putValue("blackLevel", {r:0.3,g:0.3,b:0.3}); | |
this.context.apiCallbacks.putValue("whiteLevel", {r:1,g:1,b:1}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment