# todo-memory-store

> This implements a basic in-memory store for building demo Todo list apps for bicycle. It includes two default todos so you don't have to start with the empty state.

Latest version **1.0.0** (published 2019-02-06) · 0 weekly downloads

## Install

```sh
npm install todo-memory-store
pnpm add todo-memory-store
yarn add todo-memory-store
bun add todo-memory-store
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-06 |
| First published | 2019-02-06 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | forbeslindesay |

## Links

- npm: https://www.npmjs.com/package/todo-memory-store
- Repository: https://github.com/ForbesLindesay/todo-memory-store
- Homepage: https://github.com/ForbesLindesay/todo-memory-store#readme
- Issues: https://github.com/ForbesLindesay/todo-memory-store/issues
- npm.io page: https://npm.io/package/todo-memory-store

## Recent versions

- 1.0.0 (latest) — 2019-02-06

## README

# todo-memory-store

This implements a basic in-memory store for building demo Todo list apps for bicycle. It includes two default todos so you don't have to start with the empty state.

## Installation

```
yarn add todo-memory-store
```

## Types

```typescript
interface Todo {
  id: string;
  title: string;
  completed: boolean;
}
interface TodoInput {
  title: string;
  completed: boolean;
}
```

## API

```ts
import * as store from 'todo-memory-store';
```

- `store.addTodo(todo: TodoInput): Promise<void>`
- `store.toggleAll(checked: boolean): Promise<void>`
- `store.toggle(id: string, checked: boolean): Promie<void>`
- `store.destroy(id: string): Promie<void>`
- `store.setTitle(id: string, title: string): Promie<void>`
- `store.clearCompleted(): Promie<void>`
- `store.getTodos(): Promise<Array<Todo>>`
- `store.getTodo(id: string): Promise<Todo | null>`

## Testing

The following methods are exposed for use in tests:

- `store.getTodosSync()` - get the TODO entries in the store synchronously
- `store.reset()` - reset to the two default TODO entries
- `store.setLatency(latencyMilliseconds: number)` - change the artificial latency, defaults to 200ms
- `store.enableDeterminsticIDs()` - make the UUIDs generated for newly created TODOs deterministic, rather than random
- `store.disbaleDeterminsticIDs()` - undo `enableDeterminsticIDs`
- `uuid` - generate a uuid, or get the next deterministic id

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