Skip to content

Commit a8c8375

Browse files
chore: readme (#165)
1 parent 73f4a1a commit a8c8375

File tree

3 files changed

+38
-56
lines changed

3 files changed

+38
-56
lines changed

README.md

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ npm install typescript-monads
3434
```html
3535
<head>
3636
<script src="https://unpkg.com/typescript-monads"></script>
37-
<!-- or use a specific version to avoid a redirect -->
38-
<script src="https://unpkg.com/typescript-monads@4.1.0/index.min.js"></script>
37+
<!-- or use a specific version to avoid a http redirect -->
38+
<script src="https://unpkg.com/typescript-monads@5.3.0/index.min.js"></script>
3939
</head>
4040
```
4141

@@ -51,37 +51,11 @@ typescriptMonads.maybe(someRemoteValue).tapSome(console.log)
5151
* [Either](#either)
5252
* [Reader](#reader)
5353
* [Result](#result)
54+
* [State](#state)
55+
* [Logger](#logger)
5456

5557
# Maybe
56-
```ts
57-
import { maybe } from 'typescript-monads'
58-
59-
// safely map values
60-
let maybeVisitedBeforeXTimes: number | undefined = 50
61-
62-
const priceWithDiscountForLoyalty = maybe(maybeVisitedBeforeXTimes)
63-
.match({
64-
some: visits => 15.00 - visits * 0.1,
65-
none: () => 15.00
66-
})
67-
68-
// handle multiple maybe conditions together
69-
const canRideCoaster = getAge() // Maybe<number>
70-
.map(age => getTicket(age)) // Maybe<Ticket>
71-
.match({
72-
some: ticket => ticket.canRide('coaster1'),
73-
none: () => false
74-
})
75-
76-
// operations with side-effects
77-
maybe(process.env.DB_URL)
78-
.tap({
79-
some: dbUrl => {
80-
// value exists, can connect
81-
},
82-
none: () => console.info('no url provided, could not connect to the database')
83-
})
84-
```
58+
TODO
8559

8660
## List
8761
TODO
@@ -94,3 +68,9 @@ TODO
9468

9569
## Result
9670
TODO
71+
72+
## State
73+
TODO
74+
75+
## Logger
76+
TODO

package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
"result",
2525
"either",
2626
"list",
27+
"state",
2728
"functional",
2829
"list-monad",
2930
"maybe-monad",
3031
"either-monad",
31-
"result-monad"
32+
"result-monad",
33+
"state-monad"
3234
],
3335
"scripts": {
3436
"test": "jest",
@@ -52,7 +54,7 @@
5254
"codecov": "^3.8.1",
5355
"eslint": "^7.25.0",
5456
"eslint-plugin-promise": "^5.1.0",
55-
"eslint-plugin-rxjs": "3.1.5",
57+
"eslint-plugin-rxjs": "3.2.0",
5658
"fast-check": "^2.14.0",
5759
"fs-extra": "^9.1.0",
5860
"istanbul": "^0.4.5",

0 commit comments

Comments
 (0)