# @types/redux-optimistic-ui

> TypeScript definitions for redux-optimistic-ui

Latest version **0.4.14** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/redux-optimistic-ui
pnpm add @types/redux-optimistic-ui
yarn add @types/redux-optimistic-ui
bun add @types/redux-optimistic-ui
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.14 |
| Published | 2023-11-07 |
| First published | 2016-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/redux-optimistic-ui
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-optimistic-ui
- npm.io page: https://npm.io/package/@types/redux-optimistic-ui

## Dependencies (1)

- [redux](https://npm.io/package/redux.md) ^3.6.0

## Recent versions

- 0.4.14 (latest) — 2023-11-07
- 0.4.11 (ts4.3) — 2023-04-29
- 0.4.10 (ts2.1) — 2017-10-25
- 0.4.6 (ts2.0) — 2016-11-29
- 0.4.13 — 2023-10-18
- 0.4.12 — 2023-09-27
- 0.4.9 — 2017-09-01
- 0.4.8 — 2017-08-31
- 0.4.7 — 2017-08-29
- 0.4.5 — 2016-11-21
- 0.4.4 — 2016-09-19
- 0.4.3 — 2016-08-25
- 0.4.2 — 2016-08-19
- 0.4.1 — 2016-08-02

## README

# Installation
> `npm install --save @types/redux-optimistic-ui`

# Summary
This package contains type definitions for redux-optimistic-ui (https://github.com/mattkrick/redux-optimistic-ui).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-optimistic-ui.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-optimistic-ui/index.d.ts)
````ts
/// <reference types="redux" />

declare module "redux-optimistic-ui" {
    import { Reducer } from "redux";

    /**
     * Enhanced state by redux-optimistic-ui
     */
    export interface OptimisticState<TState> {
        /**
         * History list
         * List is Immutable.List<>
         */
        history: any;
        /**
         * Before state
         */
        beforeState: TState;
        /**
         * Current state
         */
        current: TState;
    }

    /**
     * Enhances and wraps your root reducer into optimistic state
     */
    export function optimistic<TState>(reducer: Reducer<TState>): Reducer<OptimisticState<TState>>;

    /**
     * Returns your current state or state if it wasn't enhanced yet
     */
    export function ensureState<TState>(state: OptimisticState<TState> | TState): TState;

    /**
     * Optimistic action slice
     */
    export interface OptimisticAction {
        meta: {
            /**
             * Optimistic information
             */
            optimistic: {
                /**
                 * Type, BEGIN, COMMIT or REVERT
                 */
                type: string;
                /**
                 * Transaction id. Id should be unique for each optimistic action
                 */
                id: number;
            };
        };
    }

    /**
     * Start optimistic action
     */
    export const BEGIN = "@@optimist/BEGIN";
    /**
     * Finish optimistic action and commit results
     */
    export const COMMIT = "@@optimist/COMMIT";
    /**
     * Revert optimistic action
     */
    export const REVERT = "@@optimist/REVERT";
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [redux](https://npmjs.com/package/redux)

# Credits
These definitions were written by [Alexey Svetliakov](https://github.com/asvetliakov).

---
_Source: https://npm.io/package/@types/redux-optimistic-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
