How to use electrode-cookies - 10 common examples

To help you get started, we’ve selected a few electrode-cookies 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 electrode-io / electrode / samples / hapi-app / src / client / components / demo-cookies.jsx View on Github external
render() {
    // server side rendering
    let cookieValue;

    if (this.context.ssr) {
      cookieValue = `From_SSR_${Date.now()}`;
      Cookies.set(COOKIE_NAME, cookieValue, this.context.ssr);
    } else {
      cookieValue = Cookies.get(COOKIE_NAME);
    }

    return (
      <div>
        <h6>Demo Non-Redux Universal Cookies</h6>
        <p>Test cookie value: {cookieValue || ""}</p>

        <input style="{{" type="text">
        <button type="submit"> this._setCookie(x)}
        &gt;
          Update Cookie
        </button>
        </div>
github electrode-io / electrode / samples / demo-tree-shaking / src / client / components / demo-cookies.jsx View on Github external
render() {
    // server side rendering
    let cookieValue;

    if (this.context.ssr) {
      cookieValue = `From_SSR_${Date.now()}`;
      Cookies.set(COOKIE_NAME, cookieValue, this.context.ssr);
    } else {
      cookieValue = Cookies.get(COOKIE_NAME);
    }

    return (
      <div>
        <h6>Demo Non-Redux Universal Cookies</h6>
        <p>Test cookie value: {cookieValue || ""}</p>

        <input style="{{" type="text">
        <button type="submit"> this._setCookie(x)}
        &gt;
          Update Cookie
        </button>
        </div>
github electrode-io / electrode / samples / hapi-app / src / client / components / demo-cookies.jsx View on Github external
render() {
    // server side rendering
    let cookieValue;

    if (this.context.ssr) {
      cookieValue = `From_SSR_${Date.now()}`;
      Cookies.set(COOKIE_NAME, cookieValue, this.context.ssr);
    } else {
      cookieValue = Cookies.get(COOKIE_NAME);
    }

    return (
      <div>
        <h6>Demo Non-Redux Universal Cookies</h6>
        <p>Test cookie value: {cookieValue || ""}</p>

        <input style="{{" type="text">
        <button type="submit"> this._setCookie(x)}
        &gt;
          Update Cookie</button></div>
github electrode-io / electrode / samples / demo-tree-shaking / src / client / components / demo-cookies.jsx View on Github external
render() {
    // server side rendering
    let cookieValue;

    if (this.context.ssr) {
      cookieValue = `From_SSR_${Date.now()}`;
      Cookies.set(COOKIE_NAME, cookieValue, this.context.ssr);
    } else {
      cookieValue = Cookies.get(COOKIE_NAME);
    }

    return (
      <div>
        <h6>Demo Non-Redux Universal Cookies</h6>
        <p>Test cookie value: {cookieValue || ""}</p>

        <input style="{{" type="text">
        <button type="submit"> this._setCookie(x)}
        &gt;
          Update Cookie</button></div>
github electrode-io / electrode / samples / demo-tree-shaking / src / client / components / demo-cookies.jsx View on Github external
_refresh() {
    this.setState({ cookie: Cookies.get(COOKIE_NAME, this.context.ssr) });
  }
github electrode-io / electrode / samples / hapi-app / src / client / components / demo-cookies.jsx View on Github external
_refresh() {
    this.setState({ cookie: Cookies.get(COOKIE_NAME, this.context.ssr) });
  }
github electrode-io / electrode / samples / hapi-app / src / client / components / demo-cookies.jsx View on Github external
_setCookie(evt) {
    evt.preventDefault();
    const cookieValue = this.refs.newCookieValue.value;
    this.refs.newCookieValue.value = "";
    Cookies.set(COOKIE_NAME, cookieValue, this.context.ssr);
    this._refresh();
  }
github electrode-io / electrode / samples / demo-tree-shaking / src / client / components / demo-cookies.jsx View on Github external
_setCookie(evt) {
    evt.preventDefault();
    const cookieValue = this.refs.newCookieValue.value;
    this.refs.newCookieValue.value = "";
    Cookies.set(COOKIE_NAME, cookieValue, this.context.ssr);
    this._refresh();
  }
github electrode-io / electrode / samples / hapi-app / src / client / components / demo-cookies.jsx View on Github external
_expireCookie() {
    Cookies.expire(COOKIE_NAME, this.context.ssr);
    this._refresh();
  }
github electrode-io / electrode / samples / demo-tree-shaking / src / client / components / demo-cookies.jsx View on Github external
_expireCookie() {
    Cookies.expire(COOKIE_NAME, this.context.ssr);
    this._refresh();
  }

electrode-cookies

Electrode ISO cookies lib

Apache-2.0
Latest version published 4 years ago

Package Health Score

66 / 100
Full package analysis

Similar packages