# ng-set-state

> A library that helps developing UI (e.g. Angular or React) components in a more functional style where UI logic is representing as a series of immutable state transitions.

Latest version **3.0.1** (published 2023-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-set-state
pnpm add ng-set-state
yarn add ng-set-state
bun add ng-set-state
```

## 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 | 3.0.1 |
| Published | 2023-03-23 |
| First published | 2019-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 225.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Dmitry Tikhonov |
| Maintainers | 0x1000000 |
| Keywords | set state, state, react, angular |

## Links

- npm: https://www.npmjs.com/package/ng-set-state
- Repository: https://github.com/0x1000000/ngSetState
- Homepage: https://github.com/0x1000000/ngSetState#readme
- Issues: https://github.com/0x1000000/ngSetState/issues
- npm.io page: https://npm.io/package/ng-set-state

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2023-03-23
- 3.0.0 — 2023-03-17
- 2.0.1 — 2021-05-08
- 2.0.0 — 2021-04-16
- 2.0.0-alpha.4 — 2021-03-27
- 2.0.0-alpha.3 — 2021-03-26
- 2.0.0-alpha.2 — 2021-03-23
- 2.0.0-alpha.1 — 2021-03-16
- 2.0.0-alpha.0 — 2021-03-15
- 1.2.0 — 2020-07-04
- 1.1.4 — 2020-05-30
- 1.1.3 — 2020-04-25
- 1.1.1 — 2020-03-20
- 1.1.0 — 2020-02-19
- 1.0.2 — 2020-02-10
- … 10 more at https://npm.io/package/ng-set-state/versions

## README

# ngSetState

## About

A library that helps developing UI (e.g. Angular or React) components in a more functional style where UI logic is representing as a series of immutable state transitions.

* [Tutorial](https://itnext.io/angular-components-state-tracking-with-ng-set-state-e2b988540407?source=friends_link&sk=9a3596275dc73f72882fe2ec519b4528)
* [React Demo (stackblitz.com)](https://stackblitz.com/edit/react-ts-yz6kuo?file=AppStateTrack.ts)
* [Angular Demo (stackblitz.com)](https://stackblitz.com/edit/set-state-greet)
* **Demo Application** - you can find a realistic usage of the library in this ASP.Net demo application - [SqGoods](https://github.com/0x1000000/SqGoods)
* [CHANGELOG](https://github.com/0x1000000/ngSetState/blob/master/CHANGELOG.md)

## Advantages of using the library

1. __Performance__ – the angular change detection will check only already evaluated properties 
2. __Independence__ – the library does not actually depend on angular, so if you decided to move to another framework (e.g. Vue) you will be able to reuse your state logic
3. __Quality of reusable components__ – Angular allows having several input parameters which can be changed independently and maintaining all possible combinations is usually not very simple (ngOnInit, ngOnChange, property setters), so often developers take into consideration just common scenarios, which is not great when you develop reusable components. The library naturally simplifies handling different combinations of input parameters, since it implicitly creates a dependency graph over all state properties.

## [_You can find all the documentation on github.com..._](https://github.com/0x1000000/ngSetState/blob/master/README.md)

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