Skip to content

Commit daa3d8d

Browse files
Initial commit.
1 parent 39b9ae8 commit daa3d8d

19 files changed

+834
-132
lines changed

.gitignore

Lines changed: 45 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,45 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
.pnpm-debug.log*
9-
10-
# Diagnostic reports (https://nodejs.org/api/report.html)
11-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12-
13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
*.lcov
25-
26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
41-
# Dependency directories
42-
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
48-
# TypeScript cache
49-
*.tsbuildinfo
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
55-
.eslintcache
56-
57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
69-
# Output of 'npm pack'
70-
*.tgz
71-
72-
# Yarn Integrity file
73-
.yarn-integrity
74-
75-
# dotenv environment variable files
76-
.env
77-
.env.development.local
78-
.env.test.local
79-
.env.production.local
80-
.env.local
81-
82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
88-
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
92-
dist
93-
94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
122-
# Stores VSCode versions used for testing VSCode extensions
123-
.vscode-test
124-
125-
# yarn v2
126-
.yarn/cache
127-
.yarn/unplugged
128-
.yarn/build-state.yml
129-
.yarn/install-state.gz
130-
.pnp.*
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
44+
*.ignore*
45+
temp

README.md

Lines changed: 123 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,123 @@
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/

ng-package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/state",
4+
"lib": {
5+
"entryFile": "src/public-api.ts"
6+
},
7+
"keepLifecycleScripts": true
8+
}

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@typescript-package/state",
3+
"version": "1.0.0",
4+
"author": "wwwdev.io <dev@wwwdev.io>",
5+
"description": "State management for TypeScript.",
6+
"license": "MIT",
7+
"publishConfig": {
8+
"access": "public",
9+
"registry": "https://registry.npmjs.org"
10+
},
11+
"devDependencies": {},
12+
"peerDependencies": {},
13+
"scripts": {
14+
"prepublishOnly": "npm run pkg && npm run clean",
15+
"pkg": "npm pkg delete dependencies",
16+
"clean": "npm pkg delete scripts"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/typescript-package/state.git"
21+
},
22+
"bugs": {
23+
"url": "https://github.com/typescript-package/state/issues"
24+
},
25+
"keywords": [
26+
"@typescript-package",
27+
"@typescript-package/state"
28+
],
29+
"funding": [
30+
{
31+
"type": "individual",
32+
"url": "https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29"
33+
}
34+
],
35+
"sideEffects": false
36+
}

0 commit comments

Comments
 (0)