react-reactive-val 1.0.4 → 2.0.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/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2024 Jatin Parate
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # React Reactive Val
2
+
3
+ A lightweight, type-safe reactive value management library for React applications. This library provides a simple way to manage reactive values in React components with minimal boilerplate and includes powerful Context integration for efficient state sharing.
4
+
5
+ ## Features
6
+
7
+ - ðŸŽŊ **Type-safe**: Built with TypeScript for excellent type inference
8
+ - ðŸŠķ **Lightweight**: Tiny footprint with zero dependencies
9
+ - ⚡ **Fast**: Built on React's `useSyncExternalStore` for optimal performance
10
+ - 🔄 **Reactive**: Values update automatically across components
11
+ - ðŸ“Ķ **Tree-shakeable**: Only import what you need
12
+ - ðŸŒģ **Multiple formats**: Supports ESM, CommonJS, and UMD
13
+ - 🌟 **Context Support**: Share reactive values efficiently through React Context
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install react-reactive-val
19
+ # or
20
+ yarn add react-reactive-val
21
+ # or
22
+ pnpm add react-reactive-val
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### Basic Example
28
+
29
+ ```tsx
30
+ import useReactiveValue from 'react-reactive-val';
31
+
32
+ function Counter() {
33
+ const count = useReactiveValue(0);
34
+
35
+ return (
36
+ <div>
37
+ <p>Count: {count()}</p>
38
+ <button onClick={() => count(prev => prev + 1)}>Increment</button>
39
+ </div>
40
+ );
41
+ }
42
+ ```
43
+
44
+ ### Sharing State Between Components
45
+
46
+ #### Using Direct Reference
47
+
48
+ ```tsx
49
+ import { reallyReactiveVal } from 'react-reactive-val';
50
+
51
+ // Create a shared reactive value
52
+ const [sharedCount, CountProvider, useSharedCount] = reallyReactiveVal(0);
53
+
54
+ function CounterDisplay() {
55
+ return <div>Count: {sharedCount()}</div>;
56
+ }
57
+
58
+ function CounterButtons() {
59
+ return (
60
+ <div>
61
+ <button onClick={() => sharedCount(prev => prev + 1)}>Increment</button>
62
+ <button onClick={() => sharedCount(prev => prev - 1)}>Decrement</button>
63
+ </div>
64
+ );
65
+ }
66
+ ```
67
+
68
+ #### Using Context (New in v2)
69
+
70
+ ```tsx
71
+ import { reallyReactiveVal } from 'react-reactive-val';
72
+
73
+ // Create a reactive value with context
74
+ const [countValue, CountProvider, useCountContext] = reallyReactiveVal(0);
75
+
76
+ function App() {
77
+ return (
78
+ <CountProvider>
79
+ <CounterDisplay />
80
+ <CounterButtons />
81
+ </CountProvider>
82
+ );
83
+ }
84
+
85
+ function CounterDisplay() {
86
+ const count = useCountContext();
87
+ return <div>Count: {count()}</div>;
88
+ }
89
+
90
+ function CounterButtons() {
91
+ const count = useCountContext();
92
+ return (
93
+ <div>
94
+ <button onClick={() => count(prev => prev + 1)}>Increment</button>
95
+ <button onClick={() => count(prev => prev - 1)}>Decrement</button>
96
+ </div>
97
+ );
98
+ }
99
+ ```
100
+
101
+ ## API Reference
102
+
103
+ ### `useReactiveValue<T>(initialValue: T)`
104
+
105
+ A React hook that creates a reactive value within a component.
106
+
107
+ ```tsx
108
+ const value = useReactiveValue(initialValue);
109
+ ```
110
+
111
+ - `initialValue`: The initial value of the reactive state
112
+ - Returns: A function that can both read and update the value
113
+
114
+ ### `reallyReactiveVal<T>(initialValue: T)`
115
+
116
+ Creates a standalone reactive value that can be used across components. In v2, it returns a tuple containing the reactive value function, a Context Provider component, and a custom hook for accessing the value through context.
117
+
118
+ ```tsx
119
+ const [value, Provider, useValue] = reallyReactiveVal(initialValue);
120
+ ```
121
+
122
+ - `initialValue`: The initial value of the reactive state
123
+ - Returns: A tuple containing:
124
+ 1. A function that can both read and update the value
125
+ 2. A Context Provider component for wrapping consumers
126
+ 3. A custom hook for accessing the value within the Context
127
+
128
+ ### Usage with Value Getter/Setter
129
+
130
+ ```tsx
131
+ // Get the current value
132
+ const currentValue = value();
133
+
134
+ // Set a new value
135
+ value(newValue);
136
+
137
+ // Update based on previous value
138
+ value(prev => computeNewValue(prev));
139
+ ```
140
+
141
+ ## TypeScript Support
142
+
143
+ The library is written in TypeScript and provides full type inference:
144
+
145
+ ```tsx
146
+ // Type is inferred from initial value
147
+ const count = useReactiveValue(0); // type: number
148
+
149
+ // Explicit type annotation
150
+ const user = useReactiveValue<User | null>(null);
151
+
152
+ // Type checking for updates
153
+ user(prev => ({ ...prev, name: 'John' })); // Type safe!
154
+
155
+ // With Context
156
+ const [userValue, UserProvider, useUser] = reallyReactiveVal<User | null>(null);
157
+ ```
158
+
159
+ ## Contributing
160
+
161
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
162
+
163
+ 1. Fork the repository
164
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
165
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
166
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
167
+ 5. Open a Pull Request
168
+
169
+ ## License
170
+
171
+ This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.
172
+
173
+ ## Author
174
+
175
+ Jatin Parate ([@jatin4228](https://github.com/jatin4228))
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.cjs.js.LICENSE.txt */
2
- (()=>{"use strict";var e={698:(e,r)=>{var t=Symbol.for("react.transitional.element");function n(e,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var u in n={},r)"key"!==u&&(n[u]=r[u]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==r?r:null,props:n}}Symbol.for("react.fragment"),r.jsx=n},848:(e,r,t)=>{e.exports=t(698)}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{default:()=>i,reallyReactiveVal:()=>a});const o=require("react");var u=t(848);function i(e){return(0,o.useMemo)((function(){return a(e)}),[e])}var a=function(e){var r=e,t=new Set,n=(0,o.memo)((function(){return(0,o.useSyncExternalStore)((function(e){return t.add(e),function(){return t.delete(e)}}),(function(){return r}))}));return function(e){if(void 0===e)return(0,u.jsx)(n,{});r="function"==typeof e?e(r):e,t.forEach((function(e){e()}))}};module.exports=n})();
2
+ (()=>{"use strict";var e={698:(e,r)=>{var t=Symbol.for("react.transitional.element");function n(e,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var u in n={},r)"key"!==u&&(n[u]=r[u]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==r?r:null,props:n}}Symbol.for("react.fragment"),r.jsx=n},848:(e,r,t)=>{e.exports=t(698)}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{default:()=>i,reallyReactiveVal:()=>a});const o=require("react");var u=t(848);function i(e){return(0,o.useMemo)((function(){return a(e)}),[e])}var a=function(e){var r=e,t=new Set,n=(0,o.memo)((function(){return(0,o.useSyncExternalStore)((function(e){return t.add(e),function(){return t.delete(e)}}),(function(){return r}))}));function i(e){if(void 0===e)return(0,u.jsx)(n,{});r="function"==typeof e?e(r):e,t.forEach((function(e){e()}))}var a=(0,o.createContext)(i);return[i,(0,o.memo)((function(){return(0,u.jsx)(a.Provider,{value:i})})),function(){return(0,o.useContext)(a)}]};module.exports=n})();
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type ReactNode, type ReactElement } from "react";
2
- export default function useReactiveValue<T extends ReactNode>(initialValue: T): <U extends (T | ((currVal: T) => T)) | unknown | undefined>(updater?: U | undefined) => U extends T | ((currVal: T) => T) ? undefined : ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
3
- export declare const reallyReactiveVal: <T extends ReactNode>(initialValue: T) => <U extends (T | ((currVal: T) => T)) | unknown | undefined>(updater?: U) => U extends T | ((currVal: T) => T) ? undefined : ReactElement;
1
+ import { type ReactNode, type ReactElement } from 'react';
2
+ export default function useReactiveValue<T extends ReactNode>(initialValue: T): (import("react").NamedExoticComponent<object> | (<U extends (T | ((currVal: T) => T)) | unknown | undefined>(updater?: U | undefined) => U extends T | ((currVal: T) => T) ? undefined : ReactElement<unknown, string | import("react").JSXElementConstructor<any>>) | (() => <U extends (T | ((currVal: T) => T)) | unknown | undefined>(updater?: U | undefined) => U extends T | ((currVal: T) => T) ? undefined : ReactElement<unknown, string | import("react").JSXElementConstructor<any>>))[];
3
+ export declare const reallyReactiveVal: <T extends ReactNode>(initialValue: T) => ((<U extends (T | ((currVal: T) => T)) | unknown | undefined>(updater?: U) => U extends T | ((currVal: T) => T) ? undefined : ReactElement) | import("react").NamedExoticComponent<object> | (() => <U extends (T | ((currVal: T) => T)) | unknown | undefined>(updater?: U) => U extends T | ((currVal: T) => T) ? undefined : ReactElement))[];
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EAIlB,MAAM,OAAO,CAAC;AAGf,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAAE,YAAY,EAAE,CAAC,IAqC7D,CAAC,SAAS,4BAAU,OAAO,GAAG,SAAS,yJAnCtD;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,SAAS,EAAE,cAAc,CAAC,KAiCvD,CAAC,CAAC,SAAS,gBAjBM,CAAC,KAAK,CAAC,KAiBH,OAAO,GAAG,SAAS,EACnD,OAAO,CAAC,EAAE,CAAC,KACR,CAAC,wBAnBwB,CAAC,KAAK,CAAC,IAmBZ,SAAS,GAAG,YACtC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AAGf,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAAE,YAAY,EAAE,CAAC,qDAsB5D,CAAC,SAAS,4BAAU,OAAO,GAAG,SAAS,oKAAvC,CAAC,SAAS,4BAAU,OAAO,GAAG,SAAS,6JApBvD;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,SAAS,EAAE,cAAc,CAAC,QAkBrD,CAAC,SAAS,gBAFK,CAAC,KAAK,CAAC,KAEF,OAAO,GAAG,SAAS,YAC1C,CAAC,KACR,CAAC,wBAJwB,CAAC,KAAK,CAAC,IAIZ,SAAS,GAAG,YAAY,2DAFlC,CAAC,SAAS,gBAFK,CAAC,KAAK,CAAC,KAEF,OAAO,GAAG,SAAS,YAC1C,CAAC,KACR,CAAC,wBAJwB,CAAC,KAAK,CAAC,IAIZ,SAAS,GAAG,YAAY,IA4BlD,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.esm.js.LICENSE.txt */
2
- import*as e from"react";var r={698:(e,r)=>{var t=Symbol.for("react.transitional.element");function n(e,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var u in n={},r)"key"!==u&&(n[u]=r[u]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==r?r:null,props:n}}Symbol.for("react.fragment"),r.jsx=n},848:(e,r,t)=>{e.exports=t(698)}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var u=t[e]={exports:{}};return r[e](u,u.exports,n),u.exports}n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);const o=(e=>{var r={};return n.d(r,e),r})({memo:()=>e.memo,useMemo:()=>e.useMemo,useSyncExternalStore:()=>e.useSyncExternalStore});var u=n(848);function a(e){return(0,o.useMemo)((function(){return f(e)}),[e])}var f=function(e){var r=e,t=new Set,n=(0,o.memo)((function(){return(0,o.useSyncExternalStore)((function(e){return t.add(e),function(){return t.delete(e)}}),(function(){return r}))}));return function(e){if(void 0===e)return(0,u.jsx)(n,{});r="function"==typeof e?e(r):e,t.forEach((function(e){e()}))}};export{a as default,f as reallyReactiveVal};
2
+ import*as e from"react";var r={698:(e,r)=>{var t=Symbol.for("react.transitional.element");function n(e,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var u in n={},r)"key"!==u&&(n[u]=r[u]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==r?r:null,props:n}}Symbol.for("react.fragment"),r.jsx=n},848:(e,r,t)=>{e.exports=t(698)}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var u=t[e]={exports:{}};return r[e](u,u.exports,n),u.exports}n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);const o=(e=>{var r={};return n.d(r,e),r})({createContext:()=>e.createContext,memo:()=>e.memo,useContext:()=>e.useContext,useMemo:()=>e.useMemo,useSyncExternalStore:()=>e.useSyncExternalStore});var u=n(848);function a(e){return(0,o.useMemo)((function(){return f(e)}),[e])}var f=function(e){var r=e,t=new Set,n=(0,o.memo)((function(){return(0,o.useSyncExternalStore)((function(e){return t.add(e),function(){return t.delete(e)}}),(function(){return r}))}));function a(e){if(void 0===e)return(0,u.jsx)(n,{});r="function"==typeof e?e(r):e,t.forEach((function(e){e()}))}var f=(0,o.createContext)(a);return[a,(0,o.memo)((function(){return(0,u.jsx)(f.Provider,{value:a})})),function(){return(0,o.useContext)(f)}]};export{a as default,f as reallyReactiveVal};
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.umd.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactReactiveVal",["react"],t):"object"==typeof exports?exports.ReactReactiveVal=t(require("react")):e.ReactReactiveVal=t(e.React)}(this,(e=>(()=>{"use strict";var t={442:t=>{t.exports=e},698:(e,t)=>{var r=Symbol.for("react.transitional.element");function o(e,t,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==t.key&&(n=""+t.key),"key"in t)for(var a in o={},t)"key"!==a&&(o[a]=t[a]);else o=t;return t=o.ref,{$$typeof:r,type:e,key:n,ref:void 0!==t?t:null,props:o}}Symbol.for("react.fragment"),t.jsx=o},848:(e,t,r)=>{e.exports=r(698)}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{default:()=>i,reallyReactiveVal:()=>f});var a=o(442),u=o(848);function i(e){return(0,a.useMemo)((function(){return f(e)}),[e])}var f=function(e){var t=e,r=new Set,o=(0,a.memo)((function(){return(0,a.useSyncExternalStore)((function(e){return r.add(e),function(){return r.delete(e)}}),(function(){return t}))}));return function(e){if(void 0===e)return(0,u.jsx)(o,{});t="function"==typeof e?e(t):e,r.forEach((function(e){e()}))}};return n})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactReactiveVal",["react"],t):"object"==typeof exports?exports.ReactReactiveVal=t(require("react")):e.ReactReactiveVal=t(e.React)}(this,(e=>(()=>{"use strict";var t={442:t=>{t.exports=e},698:(e,t)=>{var r=Symbol.for("react.transitional.element");function o(e,t,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==t.key&&(n=""+t.key),"key"in t)for(var u in o={},t)"key"!==u&&(o[u]=t[u]);else o=t;return t=o.ref,{$$typeof:r,type:e,key:n,ref:void 0!==t?t:null,props:o}}Symbol.for("react.fragment"),t.jsx=o},848:(e,t,r)=>{e.exports=r(698)}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var u=r[e]={exports:{}};return t[e](u,u.exports,o),u.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{default:()=>i,reallyReactiveVal:()=>f});var u=o(442),a=o(848);function i(e){return(0,u.useMemo)((function(){return f(e)}),[e])}var f=function(e){var t=e,r=new Set,o=(0,u.memo)((function(){return(0,u.useSyncExternalStore)((function(e){return r.add(e),function(){return r.delete(e)}}),(function(){return t}))}));function n(e){if(void 0===e)return(0,a.jsx)(o,{});t="function"==typeof e?e(t):e,r.forEach((function(e){e()}))}var i=(0,u.createContext)(n);return[n,(0,u.memo)((function(){return(0,a.jsx)(i.Provider,{value:n})})),function(){return(0,u.useContext)(i)}]};return n})()));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-reactive-val",
3
- "version": "1.0.4",
4
- "description": "",
3
+ "version": "2.0.0",
4
+ "description": "A lightweight, type-safe reactive value management library for React applications",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
@@ -21,21 +21,61 @@
21
21
  "build:webpack": "webpack --config webpack.config.js",
22
22
  "build": "rm -rf dist && npm run build:types && npm run build:webpack",
23
23
  "prepublishOnly": "npm run build",
24
- "test": "echo \"Error: no test specified\" && exit 1"
24
+ "test": "echo \"Error: no test specified\" && exit 1",
25
+ "lint": "eslint src --ext .ts,.tsx",
26
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
27
+ "format": "prettier --write \"src/**/*.{ts,tsx}\"",
28
+ "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
29
+ "lint-staged": "lint-staged",
30
+ "prepare": "husky install"
25
31
  },
26
- "peerDependencies": {
27
- "react": "^19.0.0"
32
+ "lint-staged": {
33
+ "src/**/*.{ts,tsx}": [
34
+ "eslint --fix",
35
+ "prettier --write"
36
+ ],
37
+ "*.{json,md}": [
38
+ "prettier --write"
39
+ ]
28
40
  },
29
- "keywords": [],
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/jatin-parate/react-reactive-val.git"
44
+ },
45
+ "keywords": [
46
+ "react",
47
+ "reactive",
48
+ "state",
49
+ "management",
50
+ "typescript",
51
+ "hooks"
52
+ ],
30
53
  "author": "Jatin Parate <jatin4228@gmail.com>",
31
54
  "license": "ISC",
55
+ "bugs": {
56
+ "url": "https://github.com/jatin-parate/react-reactive-val/issues"
57
+ },
58
+ "homepage": "https://github.com/jatin-parate/react-reactive-val#readme",
59
+ "peerDependencies": {
60
+ "react": "^19.0.0"
61
+ },
32
62
  "devDependencies": {
33
63
  "@babel/core": "^7.24.0",
34
64
  "@babel/preset-env": "^7.24.0",
35
65
  "@babel/preset-react": "^7.23.3",
36
66
  "@babel/preset-typescript": "^7.23.3",
37
67
  "@types/react": "^19.1.0",
68
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
69
+ "@typescript-eslint/parser": "^7.18.0",
38
70
  "babel-loader": "^9.1.3",
71
+ "eslint": "^8.57.1",
72
+ "eslint-config-prettier": "^9.1.0",
73
+ "eslint-plugin-prettier": "^5.4.0",
74
+ "eslint-plugin-react": "^7.37.5",
75
+ "eslint-plugin-react-hooks": "^4.6.2",
76
+ "husky": "^9.1.7",
77
+ "lint-staged": "^15.5.2",
78
+ "prettier": "^3.5.3",
39
79
  "react": "^19.1.0",
40
80
  "terser-webpack-plugin": "^5.3.10",
41
81
  "typescript": "^5.8.3",