How to use the redux-zero function in redux-zero

To help you get started, we’ve selected a few redux-zero 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 axetroy / blog / src / redux / store.js View on Github external
GIST: {}, // Gist的详情
  GISTS: [] // Gist列表
};

const middlewares = applyMiddleware(
  logger(),
  persist({ key: "[rz]", storage: localForage }, function(err, state) {
    if (err) {
      console.error(err);
    } else {
      store.setState(state);
    }
  })
);

const store = createStore(initialState, middlewares);

export default store;
github ipatate / gdpr-cookies / src / UI / Store / index.js View on Github external
gdpr.toggleService();
  }

  const initialState: StoreType = {
    gdpr: gdpr,
    showModal: false,
    showBanner: isFirstVisit,
    locale,
    messages,
    // previous state list service for compare on save
    prevListService: gdpr.getListServices(),
    listService: gdpr.getListServices(),
    isFirstVisit,
  };

  const store = createStore(initialState);

  // if first visit detect click change page or action
  if (isFirstVisit === true) {
    listenClick(store);
  }
  // set global method for change setting cookie with click on link
  global._gdpr_showModal = () => {
    store.setState({showModal: true});
  };

  return store;
};
github redux-zero / redux-zero / examples / svelte / counter / src / store.ts View on Github external
import createStore  from 'redux-zero';

const initialState = { count: 0 };
const store = createStore(initialState);

export default store;
github redux-zero / redux-zero / examples / preact / counter / store.js View on Github external
import createStore from "redux-zero";

const initialState = { count: 1 };

export default createStore(initialState);
github wtf-fivem-mods / wtf_characters / ui-src / src / store.js View on Github external
import createStore from 'redux-zero'

const initialState = {
  shown: false,
  characters: [],
  steamID: null,
}

export default createStore(initialState)

redux-zero

<h1 align="center"> <img src="https://i.imgur.com/S8jnr8O.png" height="300px" alt="redux zero logo" title="redux zero logo"> <br> </h1> <p align="center" style="font-size: 1.2rem;">A lightweight state container based on Redux</p>

MIT
Latest version published 4 years ago

Package Health Score

60 / 100
Full package analysis