File tree Expand file tree Collapse file tree 3 files changed +38
-56
lines changed Expand file tree Collapse file tree 3 files changed +38
-56
lines changed Original file line number Diff line number Diff 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
8761TODO
9468
9569## Result
9670TODO
71+
72+ ## State
73+ TODO
74+
75+ ## Logger
76+ TODO
Original file line number Diff line number Diff line change 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" ,
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" ,
You can’t perform that action at this time.
0 commit comments