* This function will notify the canvas of the updates to the widgets * * @param {} newState - this can either be a callback or a new State like (prevState) => ({key: value}) * @param {*} callback - callback to run after setState
(newState, callback)
| 288 | * @param {*} callback - callback to run after setState |
| 289 | */ |
| 290 | updateState(newState, callback){ |
| 291 | // console.trace("Callback trace"); |
| 292 | // debugger; |
| 293 | |
| 294 | // FIXME: maximum recursion error when updating size, color etc |
| 295 | this.setState(newState, () => { |
| 296 | // console.log("updatinhg./..: ", this.state, newState) |
| 297 | |
| 298 | const { onWidgetUpdate } = this.props |
| 299 | |
| 300 | |
| 301 | if (this.stateUpdateCallback) |
| 302 | this.stateUpdateCallback() |
| 303 | |
| 304 | // FIXME: super inefficient |
| 305 | // if (onWidgetUpdate) { |
| 306 | // onWidgetUpdate(this.__id) |
| 307 | // } |
| 308 | |
| 309 | if (callback) callback() |
| 310 | |
| 311 | }) |
| 312 | } |
| 313 | |
| 314 | _getWidgetMethods = () => { |
| 315 | return { |
nothing calls this directly
no outgoing calls
no test coverage detected