How to use the teselagen-react-components.getCurrentParamsFromUrl 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
export function setupOptions({ that, defaultState, props }) {
  const editorDemoState = getCurrentParamsFromUrl(props.history.location);
  // localStorage.editorDemoState = props.history.location.search;
  const massagedEditorDemoState = Object.keys(editorDemoState).reduce(
    (acc, key) => {
      if (editorDemoState[key] === "false") {
        acc[key] = false;
      } else if (editorDemoState[key] === "true") {
        acc[key] = true;
      } else {
        acc[key] = editorDemoState[key];
      }
      return acc;
    },
    {}
  );
  try {
    that.state = {