motion-v 1.2.0 → 1.2.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.
package/dist/cjs/index.js CHANGED
@@ -9892,18 +9892,19 @@ function useCombineMotionValues(combineValues) {
9892
9892
  return {
9893
9893
  subscribe,
9894
9894
  unsubscribe,
9895
- value
9895
+ value,
9896
+ updateValue
9896
9897
  };
9897
9898
  }
9898
9899
  function useComputed(computed) {
9899
9900
  collectMotionValues.current = [];
9900
- const { value, subscribe, unsubscribe } = useCombineMotionValues(computed);
9901
+ const { value, subscribe, unsubscribe, updateValue } = useCombineMotionValues(computed);
9901
9902
  subscribe(collectMotionValues.current);
9902
9903
  collectMotionValues.current = void 0;
9903
- vue.onBeforeUpdate(() => {
9904
+ vue.watchEffect(() => {
9904
9905
  unsubscribe();
9905
9906
  collectMotionValues.current = [];
9906
- computed();
9907
+ updateValue();
9907
9908
  subscribe(collectMotionValues.current);
9908
9909
  collectMotionValues.current = void 0;
9909
9910
  });
@@ -3,4 +3,5 @@ export declare function useCombineMotionValues<T>(combineValues: () => T): {
3
3
  subscribe: (values: MotionValue[]) => void;
4
4
  unsubscribe: () => void;
5
5
  value: MotionValue<T>;
6
+ updateValue: () => void;
6
7
  };
@@ -19,7 +19,8 @@ function useCombineMotionValues(combineValues) {
19
19
  return {
20
20
  subscribe,
21
21
  unsubscribe,
22
- value
22
+ value,
23
+ updateValue
23
24
  };
24
25
  }
25
26
  export {
@@ -1,15 +1,15 @@
1
1
  import { useCombineMotionValues } from "./use-combine-values.mjs";
2
- import { onBeforeUpdate } from "vue";
2
+ import { watchEffect } from "vue";
3
3
  import { collectMotionValues } from "../external/.pnpm/motion-dom@12.16.0/external/motion-dom/dist/es/value/index.mjs";
4
4
  function useComputed(computed) {
5
5
  collectMotionValues.current = [];
6
- const { value, subscribe, unsubscribe } = useCombineMotionValues(computed);
6
+ const { value, subscribe, unsubscribe, updateValue } = useCombineMotionValues(computed);
7
7
  subscribe(collectMotionValues.current);
8
8
  collectMotionValues.current = void 0;
9
- onBeforeUpdate(() => {
9
+ watchEffect(() => {
10
10
  unsubscribe();
11
11
  collectMotionValues.current = [];
12
- computed();
12
+ updateValue();
13
13
  subscribe(collectMotionValues.current);
14
14
  collectMotionValues.current = void 0;
15
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-v",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",