How to use the teselagen-react-components.setCurrentParamsOnUrl function in teselagen-react-components

To help you get started, we’ve selected a few teselagen-react-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TeselaGen / openVectorEditor / demo / src / utils / setupOptions.js View on Github external
that.resetDefaultState = () => {
    that.setState({
      ...Object.keys(that.state).reduce((acc, key) => {
        acc[key] = false;
        return acc;
      }, {}),
      ...defaultState
    });
    setCurrentParamsOnUrl({}, that.props.history.replace);
    // localStorage.editorDemoState = JSON.stringify(defaultState);
  };
}
github TeselaGen / openVectorEditor / demo / src / utils / setupOptions.js View on Github external
export function setParamsIfNecessary({ that, defaultState }) {
  if (!isEqual(that.state, that.oldState)) {
    setCurrentParamsOnUrl(
      difference(that.state, defaultState),
      that.props.history.replace
    );
    that.oldState = cloneDeep(that.state);
  }
}