How to use @rematch/loading - 5 common examples

To help you get started, we’ve selected a few @rematch/loading 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 mcnamee / react-native-starter-kit / src / store / index.js View on Github external
/* 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();
  const { dispatch } = store;

  return { persistor, store, dispatch };
};
github guowenfh / vue-cli-react-base / src / store.js View on Github external
import * as models from './models'
import { init } from '@rematch/core'
import immerPlugin from '@rematch/immer'
import createLoadingPlugin from '@rematch/loading'

const immer = immerPlugin()

// see options API below
const options = {}

const loading = createLoadingPlugin(options)

const store = init({ models, plugins: [immer, loading] })
export default store
github rematch / rematch / plugins / loading-immutable / examples / react-loading-example / src / index.js View on Github external
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { init } from '@rematch/core'
import createLoadingPlugin from '@rematch/loading'
import App from './App'
import example from './example'

const loadingPlugin = createLoadingPlugin({ asNumber: true })

const store = init({
	plugins: [loadingPlugin],
	models: { example },
})

ReactDOM.render(
	
		
	,
	document.getElementById('root')
)
github rematch / rematch / plugins / loading / examples / react-loading-example / src / index.js View on Github external
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { init } from '@rematch/core'
import createLoadingPlugin from '@rematch/loading'
import App from './App'
import example from './example'

const loadingPlugin = createLoadingPlugin({ asNumber: true })

const store = init({
	plugins: [loadingPlugin],
	models: { example },
})

ReactDOM.render(
	
		
	,
	document.getElementById('root')
)
github samsonCao / react-iframe / app / store.js View on Github external
import { init } from '@rematch/core';
import { connectRouter, routerMiddleware } from 'connected-react-router';
import createLoadingPlugin from '@rematch/loading';
import createHistory from 'history/createBrowserHistory';

const options = {};
const loading = createLoadingPlugin(options);

export const history = createHistory();

const reducers = { router: connectRouter(history) };

/**
 * 基于 Rematch 实现的 Redux 最佳实践 详情查看git了解
 *
 * More: https://rematch.gitbook.io/handbook/
 *
 * 顶层的store数据,返回给应用程序使用
 */
export default (models) => init({
    redux: {
        reducers,
        middlewares: [

@rematch/loading

Loading indicator plugin for Rematch

MIT
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis

Popular @rematch/loading functions