0.0.7 • Published 3 years ago

react-crudify v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-crudify

React crudify allows you to generate a reduced crud easily with just a few lines of code. It will simplify your life and make you save time in your coding

NPM JavaScript Style Guide

Install

npm install --save react-crudify

Usage

store/reducers/project.js
import { redux } from 'react-crudify';
export default redux().reducersFor('projects')
store/reducers/index.js
import { combineReducers } from "redux";
import projectReducer from "./project";
export default combineReducers({
    projects: projectReducer
});
store/index.js
import { routerMiddleware } from 'react-router-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { createBrowserHistory } from 'history';
import rootReducer from './reducers';
export const history = createBrowserHistory();
const bindMiddleware = (middleware) => {
  if (process.env.NODE_ENV !== "production") {
    const { composeWithDevTools } = require("redux-devtools-extension");
    return composeWithDevTools(applyMiddleware(...middleware));
  }
  return applyMiddleware(...middleware);
};
export const store = createStore(
  rootReducer,
  bindMiddleware([thunk, routerMiddleware(history)])
);

Action

redux().
  • itemsFor
  • reducersFor
  • action
    • get
    • create
    • update
    • delete
    • fetch
  • getData
  • value
  • meta
Blockify().
  • block
  • element
user().
  • reducer

  • ​ login

  • ​ register
  • ​ logout
  • ​ forgotPassword
  • ​ resetPassword
  • ​ intercept
cart().
reducer().
  • basket
  • checkout
basketActions().
  • setBasketItem
  • addToBasket
  • removeFromBasket
  • clearBasket
  • addQtyItem
  • minusQtyItem
checkoutActions().
  • setShippingDetails
  • setPaymentDetails
  • resetCheckout

License

MIT © armelgeek