@pistachiojs/react 0.1.0-dev.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @pistachiojs/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React hooks built on top of @pistachiojs/core for reactive programming tasks.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@pistachiojs/react)
|
|
6
6
|
[](../../coverage)
|
|
@@ -9,7 +9,7 @@ A collection React hooks library for reactive programming tasks. Built on top of
|
|
|
9
9
|
## Key features
|
|
10
10
|
|
|
11
11
|
- **Full type safety** - TypeScript-first with complete inference
|
|
12
|
-
- **React
|
|
12
|
+
- **React specific adapters** - Designed for React 17+
|
|
13
13
|
- **Tree shakeable** - Modular imports for minimal bundle size
|
|
14
14
|
- **Well tested** - Comprehensive test coverage
|
|
15
15
|
|
|
@@ -57,12 +57,12 @@ This package is written in TypeScript and includes type definitions out of the b
|
|
|
57
57
|
import { useCounter } from '@pistachiojs/react'
|
|
58
58
|
|
|
59
59
|
function TypeSafeCounter() {
|
|
60
|
-
//
|
|
60
|
+
// full type inference
|
|
61
61
|
const [count, handlers] = useCounter(0, { min: 0, max: 100 })
|
|
62
62
|
// count: number
|
|
63
63
|
// handlers: UseCounterHandler
|
|
64
64
|
|
|
65
|
-
//
|
|
65
|
+
// all handlers are fully typed
|
|
66
66
|
handlers.increment() // () => void
|
|
67
67
|
handlers.set(50) // (value: number) => void
|
|
68
68
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pistachiojs/react",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.1.0
|
|
3
|
+
"description": "React hooks built on top of @pistachiojs/core for reactive programming tasks",
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"author": "Dirga Prakesha <dirga.prakesha@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"typescript",
|
|
15
15
|
"javascript",
|
|
16
16
|
"helpers",
|
|
17
|
-
"functional",
|
|
18
17
|
"react",
|
|
19
18
|
"type-safe",
|
|
20
19
|
"tree-shakeable"
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
34
|
"@types/react": "^17.0.0",
|
|
36
|
-
"@pistachiojs/core": "0.3.0
|
|
35
|
+
"@pistachiojs/core": "0.3.0"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {
|
|
39
38
|
"build": "rollup -c ../../rollup.config.mjs --environment TARGET:react",
|