@yiin/reactive-proxy-state 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +10 -10
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Reactive Proxy State
2
2
 
3
- [![npm version](https://badge.fury.io/js/yiin/reactive-proxy-state.svg)](https://badge.fury.io/js/yiin/reactive-proxy-state) <!-- Replace yiin/reactive-proxy-state -->
3
+ [![npm version](https://badge.fury.io/js/%40yiin%2Freactive-proxy-state.svg)](https://badge.fury.io/js/%40yiin%2Freactive-proxy-state) <!-- Replace @yiin/reactive-proxy-state -->
4
4
 
5
5
  A simple, standalone reactivity library inspired by Vue 3's reactivity system, designed for use outside of Vue, particularly in server-side contexts or for data synchronization tasks. It uses JavaScript Proxies to track changes in plain objects, Arrays, Maps, and Sets.
6
6
 
@@ -9,9 +9,9 @@ A simple, standalone reactivity library inspired by Vue 3's reactivity system, d
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- bun add yiin/reactive-proxy-state
13
- # or npm install yiin/reactive-proxy-state
14
- # or yarn add yiin/reactive-proxy-state
12
+ bun add @yiin/reactive-proxy-state
13
+ # or npm install @yiin/reactive-proxy-state
14
+ # or yarn add @yiin/reactive-proxy-state
15
15
  ```
16
16
 
17
17
  ## Core Concepts
@@ -27,7 +27,7 @@ bun add yiin/reactive-proxy-state
27
27
  Creates a reactive proxy for the given object, Array, Map, or Set. Nested objects/collections are also recursively wrapped.
28
28
 
29
29
  ```typescript
30
- import { wrapState } from 'yiin/reactive-proxy-state';
30
+ import { wrapState } from '@yiin/reactive-proxy-state';
31
31
 
32
32
  const state = wrapState({
33
33
  count: 0,
@@ -52,7 +52,7 @@ Creates a reactive "reference" object for any value type (primitive or object).
52
52
  **Note:** If a plain object is passed to `ref`, the object *itself* is not made deeply reactive. Only assignment to the `.value` property is tracked. Use `wrapState` for deep object reactivity.
53
53
 
54
54
  ```typescript
55
- import { ref, watchEffect, isRef, unref } from 'yiin/reactive-proxy-state';
55
+ import { ref, watchEffect, isRef, unref } from '@yiin/reactive-proxy-state';
56
56
 
57
57
  // Ref for a primitive
58
58
  const count = ref(0);
@@ -96,7 +96,7 @@ Creates a computed property based on a getter function. The getter tracks reacti
96
96
  Computed refs are read-only.
97
97
 
98
98
  ```typescript
99
- import { ref, computed, watchEffect, isComputed } from 'yiin/reactive-proxy-state';
99
+ import { ref, computed, watchEffect, isComputed } from '@yiin/reactive-proxy-state';
100
100
 
101
101
  const firstName = ref('John');
102
102
  const lastName = ref('Doe');
@@ -157,7 +157,7 @@ Runs a function immediately, tracks its reactive dependencies, and re-runs it sy
157
157
  * `onTrigger?(event)`: Debug hook called when the effect is triggered by a mutation.
158
158
 
159
159
  ```typescript
160
- import { wrapState, ref, watchEffect } from 'yiin/reactive-proxy-state';
160
+ import { wrapState, ref, watchEffect } from '@yiin/reactive-proxy-state';
161
161
 
162
162
  // ... existing watchEffect example using wrapState ...
163
163
 
@@ -182,7 +182,7 @@ Watches a specific reactive source (either a getter function, a direct reactive
182
182
  * `deep?: boolean`: If `true`, deeply traverses the source for dependency tracking and uses deep comparison logic. **Defaults to `true`**. Set to `false` for shallow watching (only triggers on direct assignment or identity change).
183
183
 
184
184
  ```typescript
185
- import { wrapState, ref, watch } from 'yiin/reactive-proxy-state';
185
+ import { wrapState, ref, watch } from '@yiin/reactive-proxy-state';
186
186
 
187
187
  // ... existing watch examples using wrapState ...
188
188
 
@@ -209,7 +209,7 @@ doubleCount.value = 110; // Output: Double changed from 200 to 220
209
209
  `wrapState` automatically handles Arrays, Maps, and Sets. Mutations via standard methods (`push`, `pop`, `splice`, `set`, `delete`, `add`, `clear`, etc.) are reactive and will trigger effects that depend on the collection or its contents (if watched deeply).
210
210
 
211
211
  ```typescript
212
- import { wrapState, watchEffect } from 'yiin/reactive-proxy-state';
212
+ import { wrapState, watchEffect } from '@yiin/reactive-proxy-state';
213
213
 
214
214
  const state = wrapState({
215
215
  list: [1, 2],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yiin/reactive-proxy-state",
3
3
  "private": false,
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "A simple, standalone reactivity library using Proxies",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -48,4 +48,4 @@
48
48
  "bun-types": "^1.2.8",
49
49
  "typescript": "^5.0.4"
50
50
  }
51
- }
51
+ }