# grocery-store

> Store objects are responsible for holding state and providing actions to mutate that state. You can have as many store objects as you need to keep them simple and responsible for a small part of your app state. Grocery is a library to help facilitate that

Latest version **0.0.1** (published 2021-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install grocery-store
pnpm add grocery-store
yarn add grocery-store
bun add grocery-store
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-09-18 |
| First published | 2021-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 35 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael Miller-Hairston |
| Maintainers | mmiller-hairston |

## Links

- npm: https://www.npmjs.com/package/grocery-store
- npm.io page: https://npm.io/package/grocery-store

## Recent versions

- 0.0.1 (latest) — 2021-09-18

## README

# grocery

Store objects are responsible for holding state and providing actions to mutate that state. You can have as many store objects as you need to keep them simple and responsible for a small part of your app state. Grocery is a library to help facilitate that process.

## install

> npm install

## usage

```js
const store = createStore();

// Add an array named 'collection' to the store.
const collection = store.createCart('collection');

// Add an item to the array
collection.addItem(item);

// Update an item in the array
collection.updateItem(id, item);

// Remove an item in the array
collection.removeItem(id);

// Return array to default value
collection.clearCart();

// Get current value of cart
collection.getCart();

// Add an object named 'item' to the store.
const item = store.createItem('item');

// Update value of item
item.updateItem(item);

// Return item to default state
item.clearItem();

// Get current value of item
item.getItem();
```

---
_Source: https://npm.io/package/grocery-store · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
