|
1 | | -# state |
2 | | -State management for TypeScript. |
| 1 | + |
| 2 | +<a href="https://www.typescriptlang.org/"> |
| 3 | + <img |
| 4 | + src="https://raw.githubusercontent.com/typescript-package/core/refs/heads/main/ts-package-barcode-logo-512.png" |
| 5 | + width="20%" |
| 6 | + title="@typescript-package/state" |
| 7 | + /> |
| 8 | +</a> |
| 9 | + |
| 10 | +## typescript-package/state |
| 11 | + |
| 12 | + |
| 13 | +<!-- npm badge --> |
| 14 | +[![npm version][typescript-package-npm-badge-svg]][typescript-package-npm-badge] |
| 15 | +[![GitHub issues][typescript-package-badge-issues]][typescript-package-issues] |
| 16 | +[![GitHub license][typescript-package-badge-license]][typescript-package-license] |
| 17 | + |
| 18 | +<br> |
| 19 | + |
| 20 | +## Table of contents |
| 21 | + |
| 22 | +* [Installation](#installation) |
| 23 | +* [Api](#api) |
| 24 | +* [Immutability](#immutability) |
| 25 | + * [Sealed](#sealed) |
| 26 | + * [Frozen](#frozen) |
| 27 | + * [Locked](#locked) |
| 28 | +* [Git](#git) |
| 29 | + * [Commit](#commit) |
| 30 | + * [Versioning](#versioning) |
| 31 | +* [License](#license) |
| 32 | + |
| 33 | +## Installation |
| 34 | + |
| 35 | +```bash |
| 36 | +npm install @typescript-package/state |
| 37 | +``` |
| 38 | + |
| 39 | +## Api |
| 40 | + |
| 41 | +```typescript |
| 42 | +import { |
| 43 | + BooleanState, |
| 44 | + EnumState, |
| 45 | + NullState, |
| 46 | + NumberState, |
| 47 | + ImmutableState, |
| 48 | + State |
| 49 | +} from '@typescript-package/state'; |
| 50 | +``` |
| 51 | + |
| 52 | +## Immutability |
| 53 | + |
| 54 | +### Sealed |
| 55 | + |
| 56 | +Provides structural immutability, but not value immutability. The least strict form of immutability. |
| 57 | + |
| 58 | +### Frozen |
| 59 | + |
| 60 | +Provides structural and shallow immutability. Stricter than seal. |
| 61 | + |
| 62 | +### Locked |
| 63 | + |
| 64 | +It's not native JavaScript state. Combines the features of `freeze` but extends immutability to nested structures(deep immutability). |
| 65 | + |
| 66 | +## GIT |
| 67 | + |
| 68 | +### Commit |
| 69 | + |
| 70 | +* [AngularJS Git Commit Message Conventions][git-commit-angular] |
| 71 | +* [Karma Git Commit Msg][git-commit-karma] |
| 72 | +* [Conventional Commits][git-commit-conventional] |
| 73 | + |
| 74 | +### Versioning |
| 75 | + |
| 76 | +[Semantic Versioning 2.0.0][git-semver] |
| 77 | + |
| 78 | +**Given a version number MAJOR.MINOR.PATCH, increment the:** |
| 79 | + |
| 80 | +* MAJOR version when you make incompatible API changes, |
| 81 | +* MINOR version when you add functionality in a backwards-compatible manner, and |
| 82 | +* PATCH version when you make backwards-compatible bug fixes. |
| 83 | + |
| 84 | +Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. |
| 85 | + |
| 86 | +**FAQ** |
| 87 | +How should I deal with revisions in the 0.y.z initial development phase? |
| 88 | + |
| 89 | +> The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release. |
| 90 | +
|
| 91 | +How do I know when to release 1.0.0? |
| 92 | + |
| 93 | +> If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0. |
| 94 | +
|
| 95 | +## License |
| 96 | + |
| 97 | +MIT © typescript-package ([license][typescript-package-license]) |
| 98 | + |
| 99 | +<!-- This package: typescript-package --> |
| 100 | + <!-- GitHub: badges --> |
| 101 | + [typescript-package-badge-issues]: https://img.shields.io/github/issues/typescript-package/state |
| 102 | + [isscript-package-badge-forks]: https://img.shields.io/github/forks/typescript-package/state |
| 103 | + [typescript-package-badge-stars]: https://img.shields.io/github/stars/typescript-package/state |
| 104 | + [typescript-package-badge-license]: https://img.shields.io/github/license/typescript-package/state |
| 105 | + <!-- GitHub: badges links --> |
| 106 | + [typescript-package-issues]: https://github.com/typescript-package/state/issues |
| 107 | + [typescript-package-forks]: https://github.com/typescript-package/state/network |
| 108 | + [typescript-package-license]: https://github.com/typescript-package/state/blob/master/LICENSE |
| 109 | + [typescript-package-stars]: https://github.com/typescript-package/state/stargazers |
| 110 | +<!-- This package --> |
| 111 | + |
| 112 | +<!-- Package: typescript-package --> |
| 113 | + <!-- npm --> |
| 114 | + [typescript-package-npm-badge-svg]: https://badge.fury.io/js/@typescript-package%2Fstate.svg |
| 115 | + [typescript-package-npm-badge]: https://badge.fury.io/js/@typescript-package%2Fstate |
| 116 | + |
| 117 | +<!-- GIT --> |
| 118 | +[git-semver]: http://semver.org/ |
| 119 | + |
| 120 | +<!-- GIT: commit --> |
| 121 | +[git-commit-angular]: https://gist.github.com/stephenparish/9941e89d80e2bc58a153 |
| 122 | +[git-commit-karma]: http://karma-runner.github.io/0.10/dev/git-commit-msg.html |
| 123 | +[git-commit-conventional]: https://www.conventionalcommits.org/en/v1.0.0/ |
0 commit comments