We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
makeWrappable
1 parent 65ccbc5 commit a472b46Copy full SHA for a472b46
packages/solid/store/src/store.ts
@@ -79,6 +79,22 @@ export function isWrappable(obj: any) {
79
);
80
}
81
82
+/**
83
+ * Forces an object/class to get wrapped
84
+ * @param obj object
85
+ * @example
86
+ * ```js
87
+ * class Example {
88
+ * constructor() {
89
+ * makeWrappable(this) // make every instance of a class wrap
90
+ * }
91
92
+ * ```
93
+ */
94
+export function makeWrappable<T>(obj: T) {
95
+ Object.defineProperty(obj, $WRAP, { value: true });
96
+}
97
+
98
/**
99
* Returns the underlying data in the store without a proxy.
100
* @param item store proxy object
0 commit comments