# @asoft-ltd/live-react

> An Observable Object

Latest version **0.0.15** (published 2021-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @asoft-ltd/live-react
pnpm add @asoft-ltd/live-react
yarn add @asoft-ltd/live-react
bun add @asoft-ltd/live-react
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.15 |
| Published | 2021-03-13 |
| First published | 2021-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | andylamax |
| Maintainers | andylamax |
| Keywords | observable, live, state |

## Links

- npm: https://www.npmjs.com/package/@asoft-ltd/live-react
- Repository: https://github.com/aSoft-Ltd/live-typescript/tree/master/live-react
- npm.io page: https://npm.io/package/@asoft-ltd/live-react

## Dependencies (1)

- [@asoft-ltd/live-core](https://npm.io/package/@asoft-ltd/live-core.md) 0.0.15

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 0.0.15 (latest) — 2021-03-13
- 0.0.15-dev05 — 2021-03-13
- 0.0.15-dev04 — 2021-03-13
- 0.0.15-dev03 — 2021-03-13
- 0.0.15-dev02 — 2021-03-13
- 0.0.15-dev01 — 2021-03-13

## README

# Live React

![badge][badge-maven] ![badge][badge-mpp] ![badge][badge-android] ![badge][badge-js] ![badge][badge-jvm] ![badge][badge-ios]

## Introduction
Built on top of [Live<T>](../live-core), this extension will get you a react hook that follows `Live<T>` and updates it's value when the value of `Live<T>` changes

## Setup

```
npm install @asoft-ltd/live-react
```

## Samples

Step 1: get the `useLive` hook
```kotlin
import { Live, useLive } from "@asoft-ltd/live-react"

const live = new Live(1)

interface CounterProps {
  onToggle: () => void
}

function Counter(props: CounterProps) {
  const value = useLive(live)
  return (
    <div className="App">Live Value: {value}</div>
  );
}
```

### Note:

Since `Live<S>` should only be used in presentational layers and it's main purpose is to just change state for ui, `useLive` doesn't provide the mechanism to update the state.

[badge-maven]: https://img.shields.io/maven-central/v/tz.co.asoft/live-core/0.0.15?style=flat

[badge-mpp]: https://img.shields.io/badge/kotlin-multiplatform-blue?style=flat

[badge-android]: http://img.shields.io/badge/platform-android-brightgreen.svg?style=flat

[badge-js]: http://img.shields.io/badge/platform-js-yellow.svg?style=flat

[badge-jvm]: http://img.shields.io/badge/platform-jvm-orange.svg?style=flat

[badge-ios]: http://img.shields.io/badge/platform-ios-silver.svg?style=flat

---
_Source: https://npm.io/package/@asoft-ltd/live-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
