generic-redux-cart

1.2.1 • Public • Published

A GENERIC CART BASED ON REDUX

Methods

add to cart

import { store } from "generic-redux-cart/index.js";

import { addItem, } from "generic-redux-cart/ActionCreators.js";

const newItem = { name: "Mazda cx9", price: 240000, quantity: 1, id: 8, };

addItem(newItem);

clear cart

import { clear } from "generic-redux-cart/ActionCreators.js";

clear();

remove item from cart

import { deleteItem } from "generic-redux-cart/ActionCreators.js";

deleteItem(itemId)

subscribe to cart changes

import {store} from "generic-redux-cart/index.js";

store.subscribe(() => { console.log(store.getState()); });

/generic-redux-cart/

    Package Sidebar

    Install

    npm i generic-redux-cart

    Weekly Downloads

    1

    Version

    1.2.1

    License

    ISC

    Unpacked Size

    4.22 kB

    Total Files

    8

    Last publish

    Collaborators

    • pius_kariuki