How to use the lockr.set function in lockr

To help you get started, we’ve selected a few lockr 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 learningequality / kolibri / kolibri / core / assets / src / heartbeat.js View on Github external
signOutDueToInactivity() {
    // Store that this sign out was for inactivity in local storage.
    Lockr.set(SIGNED_OUT_DUE_TO_INACTIVITY, true);
    // Redirect the user to let the server sort out where they should
    // be now
    redirectBrowser();
  }
  _sessionUrl(id) {
github Ameobea / polotrack / frontend / src / components / FileUploader.js View on Github external
setTimeout(() => {
      this.setState({
        confirmLoading: false,
      });

      // store the uploaded data in localStorage so it's persistant
      Lockr.prefix = 'userData';
      Lockr.set('deposits', JSON.stringify(this.props.deposits));
      Lockr.set('withdrawls', JSON.stringify(this.props.withdrawls));
      Lockr.set('trades', JSON.stringify(this.props.trades));
      Lockr.set('demo', JSON.stringify(false));

      // signal that all data has been successfully uploaded and that it's time to show some juicy visualizations
      this.props.dispatch({type: 'userData/allDataUploaded'});
      this.hideFileUploader();

      // since this is real user data, set the `isDemo` flag to false
      this.props.dispatch({type: 'globalData/setDemoFlag', isDemo: false});

      // hard-refresh the page since components are wired to not watch for changes to static user data
      window.location.reload();
    }, 1234);
    this.setState({
github tronscan / tronscan-frontend / src / components / blockchain / Compiler / index.js View on Github external
componentWillUnmount() {
        let { code, CompileStatus, compileInfo, contractNameList, compileFiles } = this.state;
        if (CompileStatus && code !== '// type your code...'){
            Lockr.set('CompileCode', code);
            Lockr.set('CompileStatus', CompileStatus);
            Lockr.set('compileInfo', compileInfo);
            Lockr.set('contractNameList', contractNameList);

            // file转base64保存
            let list = [];
            compileFiles.map(v => {
                let reader = new FileReader();
                const isFile = v instanceof File;
                reader.readAsDataURL(isFile ? v : v.originFileObj, 'UTF-8');
                reader.onloadend = (evt) => {
                    const dataUrl = evt.target.result;
                    list.push({ dataUrl, name: v.name });
                    Lockr.set('compileFiles', list);
                };
            });
        }
    }
github tronscan / tronscan-frontend / src / components / blockchain / Compiler / index.js View on Github external
reader.onloadend = (evt) => {
                    const dataUrl = evt.target.result;
                    list.push({ dataUrl, name: v.name });
                    Lockr.set('compileFiles', list);
                };
            });
github tronscan / tronscan-frontend / src / components / exchange / dex10 / components / ExchangeList / index.js View on Github external
this.setState({
          optional
        });
      }
      Lockr.set("optional", optional);
    } else {
      let optional = Lockr.get("dex20") || [];

      if (optional.indexOf(id) == -1) {
        optional.push(id);
      } else {
        optional = _.remove(optional, n => {
          return n !== id;
        });
      }
      Lockr.set("dex20", optional);
    }
  };
github tronscan / tronscan-frontend / src / components / Home / index.js View on Github external
async loadHomepageBundle() {
    let { data } = await xhr.get(`${API_URL}/api/system/homepage-bundle`);
    Lockr.set("dataEth", data.priceETH);
    Lockr.set("dataEur", data.priceEUR);
    this.setState({
      onlineNodes: data.node.total,
      maxTps: data.tps.data.maxTps ? data.tps.data.maxTps : 0,
      tps: data.tps.data.currentTps ? data.tps.data.currentTps : 0,
      blockHeight: data.tps.data.blockHeight ? data.tps.data.blockHeight : 0,
      transactionPerDay: data.yesterdayStat.data[0].newTransactionSeen
    });
  }
github xxdavid / lastfm-friends-who-listen / src / storage.js View on Github external
export function setCollapseNumber(value) {
    lockr.set('collapseNumber', value);
}
github tronscan / tronscan-frontend / src / components / Home / index.js View on Github external
async loadHomepageBundle() {
    let { data } = await xhr.get(`${API_URL}/api/system/homepage-bundle`);
    Lockr.set("dataEth", data.priceETH);
    Lockr.set("dataEur", data.priceEUR);
    this.setState({
      onlineNodes: data.node.total,
      maxTps: data.tps.data.maxTps ? data.tps.data.maxTps : 0,
      tps: data.tps.data.currentTps ? data.tps.data.currentTps : 0,
      blockHeight: data.tps.data.blockHeight ? data.tps.data.blockHeight : 0,
      transactionPerDay: data.yesterdayStat.data[0].newTransactionSeen
    });
  }
github roblav96 / robinhood.tools / src / client / routes / lists / lists.ts View on Github external
}).finally(() => {
			lockr.set('lists.lists', lists)
			this.lists = lists
		})
	}
github xxdavid / lastfm-friends-who-listen / src / storage.js View on Github external
export function setWaitUntilFetched(boolean) {
    lockr.set('waitUntilFetched', boolean);
}

lockr

![Lockr logo](http://i.imgur.com/m5kPjkB.png)

MIT
Latest version published 1 year ago

Package Health Score

54 / 100
Full package analysis