yummies 4.13.0 → 4.14.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.
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AnyObject } from '../utils/types.js';
|
|
2
|
+
export type ObservableAnnotationsArray = [string, any][];
|
|
3
|
+
export declare const applyObservable: (context: AnyObject, annotationsArray: ObservableAnnotationsArray, useDecorators?: boolean) => void;
|
|
4
|
+
//# sourceMappingURL=apply-observable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-observable.d.ts","sourceRoot":"","sources":["../../src/mobx/apply-observable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;AAEzD,eAAO,MAAM,eAAe,GAC1B,SAAS,SAAS,EAClB,kBAAkB,0BAA0B,EAC5C,gBAAgB,OAAO,SAWxB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { makeObservable } from 'mobx';
|
|
2
|
+
export const applyObservable = (context, annotationsArray, useDecorators) => {
|
|
3
|
+
if (useDecorators) {
|
|
4
|
+
annotationsArray.forEach(([field, annotation]) => {
|
|
5
|
+
annotation(context, field);
|
|
6
|
+
});
|
|
7
|
+
makeObservable(context);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
makeObservable(context, Object.fromEntries(annotationsArray));
|
|
11
|
+
}
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yummies",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "js2me",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"tailwind-merge": "^3.3.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@biomejs/biome": "2.2.2",
|
|
39
40
|
"@changesets/changelog-github": "^0.5.1",
|
|
40
41
|
"@changesets/cli": "^2.29.5",
|
|
41
|
-
"@biomejs/biome": "2.1.4",
|
|
42
42
|
"@types/node": "^20.17.30",
|
|
43
43
|
"@types/react": "^18",
|
|
44
44
|
"@vitejs/plugin-react-swc": "^3.9.0",
|
|
@@ -199,6 +199,11 @@
|
|
|
199
199
|
"default": "./media.js",
|
|
200
200
|
"types": "./media.d.ts"
|
|
201
201
|
},
|
|
202
|
+
"./mobx/apply-observable": {
|
|
203
|
+
"import": "./mobx/apply-observable.js",
|
|
204
|
+
"default": "./mobx/apply-observable.js",
|
|
205
|
+
"types": "./mobx/apply-observable.d.ts"
|
|
206
|
+
},
|
|
202
207
|
"./mobx/deep-observable-struct.test": {
|
|
203
208
|
"import": "./mobx/deep-observable-struct.test.js",
|
|
204
209
|
"default": "./mobx/deep-observable-struct.test.js",
|
package/sound.js
CHANGED