File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -50,35 +50,8 @@ Here’s how you can use it to empower your projects:
50
50
npm i -D crystalize.js
51
51
```
52
52
53
- TypeScript:
54
-
55
- ``` typescript
56
- import Crystalizer from ' crystalize.js' ;
57
-
58
- type Crystal = { total: number };
59
- type Shard = { id: number ; value: number };
60
-
61
- let crystalizer = new Crystalizer <Crystal , Shard >({
62
- initial: { total: 0 },
63
- reduce : (crystal , shard ) => ({
64
- ... crystal ,
65
- total: crystal .total + shard .value ,
66
- }),
67
- });
68
- ```
69
-
70
- JavaScript:
71
-
72
53
``` typescript
73
54
import Crystalizer from ' crystalize.js' ;
74
-
75
- let crystalizer = new Crystalizer ({
76
- initial: { total: 0 },
77
- reduce : (crystal , shard ) => ({
78
- ... crystal ,
79
- total: crystal .total + shard .value ,
80
- }),
81
- });
82
55
```
83
56
84
57
## API reference
You can’t perform that action at this time.
0 commit comments