@@ -2,8 +2,9 @@ import { dynamicallyExecuteFunction } from './functions/helpers';
22import { ref , shallowRef , readonly } from 'vue' ;
33
44/**
5- * It takes a value and returns an object with a value property that is a shallowRef/ref of the value.
6- * passed in, and Subscribers(function) are added to a list to be executed when the value is changed.
5+ * It takes a value and returns an object with a value property that is a shallowRef/ref of the value
6+ * passed in and Subscribers(function) are added to a list to be executed when the value is changed.
7+ * @example useSubscription<T>(value: T, deep = false)
78 * @param {T } value - T - The initial value of the subscription.
89 * @param {boolean } deep - T - If it should be deep reactivity. By default it is Shallow.
910 * @returns A function that returns an object with a shallow/deep reactive value, a subscriber and a
@@ -78,7 +79,7 @@ export function useSubscription<T>(value: T, deep = false) {
7879 else setValue ( val ) ;
7980 } ,
8081
81- /** ReadOnly version of value. Wraps the shallow ref in readonly */
82+ /** ReadOnly version of value. Wraps the ref in readonly */
8283 $read : readonly ( _subRef ) ,
8384
8485 /**
@@ -108,7 +109,7 @@ export function useSubscription<T>(value: T, deep = false) {
108109 */
109110 $mutate ( mutator : ValueMutator ) {
110111 if ( typeof _subRef . value !== 'object' ) {
111- throw new Error ( 'Value passed is not an typeof object! Patch only accepts typeof object' ) ;
112+ throw new Error ( 'Value passed is not an typeof object! $mutate only accepts ` typeof object` ' ) ;
112113 }
113114 mutateSubscriber ( mutator ) ;
114115 }
0 commit comments