Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable react/jsx-filename-extension */
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { init } from '@rematch/core'
import createPersistPlugin, { getPersistor } from '@rematch/persist'
import { PersistGate } from 'redux-persist/es/integration/react'
import * as models from './models'
import App from './App'
const persistPlugin = createPersistPlugin({
version: 2,
whitelist: ['persisted'],
})
const store = init({
models,
plugins: [persistPlugin],
})
ReactDOM.render(
,
document.getElementById('root')
/* global */
import { init } from '@rematch/core';
import createPersistPlugin, { getPersistor } from '@rematch/persist';
import createLoadingPlugin from '@rematch/loading';
import storage from 'redux-persist/es/storage';
import * as models from '../models';
// Create plugins
const persistPlugin = createPersistPlugin({
version: 2,
storage,
blacklist: [],
});
const loadingPlugin = createLoadingPlugin({});
const configureStore = () => {
const store = init({
models,
redux: {
middlewares: [],
},
plugins: [persistPlugin, loadingPlugin],
});
const persistor = getPersistor();
import { init } from '@rematch/core';
import createRematchPersist, { getPersistor } from '@rematch/persist';
import React from 'react';
import { AsyncStorage, View } from 'react-native';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/es/integration/react';
import * as models from './models';
const persistPlugin = createRematchPersist({
whiteList: ['user', 'onBoarding'],
blackList: ['users', 'hasMoreUsers', 'isLoadingUsers'],
// throttle: 5000,
version: 3,
storage: AsyncStorage,
});
export const store = init({
models,
plugins: [persistPlugin],
});
class Gate extends React.Component {
render() {
return (
import { init } from '@rematch/core';
import createRematchPersist, { getPersistor } from '@rematch/persist';
import React from 'react';
import { AsyncStorage } from 'react-native';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/es/integration/react';
import * as models from './models';
const persistPlugin = createRematchPersist({
// whiteList: ['user', 'onBoarding'],
// blackList: ['users', 'hasMoreUsers', 'isLoadingUsers'],
// throttle: 5000,
version: 3,
storage: AsyncStorage,
});
const PERSIST_DATA = false;
export const store = init({
models,
plugins: [PERSIST_DATA && persistPlugin],
});
global.__rematch_store = store;
global.__rematch_dispatch = store.dispatch;
import { init } from '@rematch/core';
import createRematchPersist, { getPersistor } from '@rematch/persist';
import React from 'react';
import { AsyncStorage } from 'react-native';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/es/integration/react';
import * as models from './models';
const persistPlugin = createRematchPersist({
// whiteList: ['user', 'onBoarding'],
// blackList: ['users', 'hasMoreUsers', 'isLoadingUsers'],
// throttle: 5000,
version: 3,
storage: AsyncStorage,
});
const PERSIST_DATA = false;
export const store = init({
models,
plugins: [PERSIST_DATA && persistPlugin],
});
global.__rematch_store = store;
global.__rematch_dispatch = store.dispatch;
import { init } from '@rematch/core';
import createRematchPersist, { getPersistor } from '@rematch/persist';
import React from 'react';
import { AsyncStorage, View } from 'react-native';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/es/integration/react';
import * as models from './models';
const persistPlugin = createRematchPersist({
whiteList: ['score', 'user', 'currency'],
// throttle: 5000,
version: 2,
storage: AsyncStorage,
});
export const store = init({
models,
plugins: [persistPlugin],
});
class Gate extends React.Component {
static propTypes = {
children: View.propTypes.children.isRequired,
};
render() {
import { init } from '@rematch/core';
import createRematchPersist from '@rematch/persist';
import * as models from './models';
/**
* Allow information to be locally saved for next sessions.
* More information about `redux-persist` configuration:
* @see https://github.com/rt2zz/redux-persist/blob/master/docs/api.md#type-persistconfig
*/
const persistPlugin = createRematchPersist({
whitelist: ['history', 'ui'],
});
/**
* This project uses Rematch, built upon Redux.
* If you're into Redux and don't like creating `actions` all the time,
* give it a try. I really like it much more.
* @see https://github.com/rematch/rematch
*/
export const store = init({
models,
plugins: [persistPlugin],
});
import { init } from '@rematch/core'
import createPersistPlugin from '@rematch/persist'
import { locationChangeListener } from 'models/location'
import * as models from 'models'
const persistPlugin = createPersistPlugin({
key: 'eosdapp',
whitelist: ['session', 'settings']
})
const store = init({
models,
plugins: [persistPlugin]
})
locationChangeListener(store)
export default store
import { init } from '@rematch/core';
import { getPersistor } from '@rematch/persist';
import createRematchPersist from '@rematch/persist';
import React from 'react';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/es/integration/react';
import * as models from './models';
import { AsyncStorage } from 'react-native';
const persistPlugin = createRematchPersist({
whiteList: ['score'],
version: 2,
storage: AsyncStorage,
});
export const store = init({
models,
plugins: [persistPlugin],
});
class Gate extends React.Component {
render() {
return (
{this.props.children}
const configureStore = () => {
const store = init({
models,
redux: {
middlewares: [],
},
plugins: [persistPlugin, loadingPlugin],
});
const persistor = getPersistor();
const { dispatch } = store;
return { persistor, store, dispatch };
};