react-state-custom 1.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/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +8 -0
- package/.yarnrc.yml +1 -0
- package/README.md +57 -0
- package/dist/components/MyComponent.d.ts +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +1013 -0
- package/dist/index.umd.js +22 -0
- package/dist/state-utils/createRootCtx.d.ts +5 -0
- package/dist/state-utils/ctx.d.ts +94 -0
- package/dist/state-utils/useQuickSubscribe.d.ts +2 -0
- package/dist/state-utils/useQuickSubscribeV2.d.ts +2 -0
- package/dist/state-utils/useRefValue.d.ts +1 -0
- package/fix-vscode-yarn-pnp.sh +26 -0
- package/package.json +35 -0
- package/src/components/MyComponent.tsx +17 -0
- package/src/index.ts +19 -0
- package/src/state-utils/createRootCtx.tsx +56 -0
- package/src/state-utils/ctx.ts +308 -0
- package/src/state-utils/useQuickSubscribe.ts +115 -0
- package/src/state-utils/useQuickSubscribeV2.ts +93 -0
- package/src/state-utils/useRefValue.ts +8 -0
- package/tsconfig.json +18 -0
- package/vite.config.ts +33 -0
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: pnp
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# My React Library
|
|
2
|
+
|
|
3
|
+
This is a simple React library created using Yarn, Vite, and TypeScript. It includes a sample component that can be used in your React applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To install the library, you can use Yarn:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add my-react-library
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
To use the `MyComponent` in your React application, you can import it as follows:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { MyComponent } from 'my-react-library';
|
|
19
|
+
|
|
20
|
+
const App = () => {
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<MyComponent propName="value" />
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default App;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
To start developing the library, clone the repository and install the dependencies:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git clone <repository-url>
|
|
37
|
+
cd my-react-library
|
|
38
|
+
yarn install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To run the development server, use:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
yarn dev
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Building
|
|
48
|
+
|
|
49
|
+
To build the library for production, run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
yarn build
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
This project is licensed under the MIT License. See the LICENSE file for more details.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Context, getContext, useDataContext, useDataSource, useDataSourceMultiple, useDataSubscribe, useDataSubscribeMultiple, useDataSubscribeMultipleWithDebounce, useDataSubscribeWithTransform } from './state-utils/ctx';
|
|
2
|
+
export { createRootCtx } from './state-utils/createRootCtx';
|
|
3
|
+
export { useQuickSubscribeV2 as useQuickSubscribe } from './state-utils/useQuickSubscribeV2';
|