@joist/observable 2.0.0-beta.0 → 2.0.0-beta.3

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/README.md CHANGED
@@ -6,7 +6,7 @@ Decorating a class with `@observable` means that instances of that class will BE
6
6
  #### Installation:
7
7
 
8
8
  ```BASH
9
- npm i @joist/observable@alpha
9
+ npm i @joist/observable@beta
10
10
  ```
11
11
 
12
12
  #### Example:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joist/observable",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.3",
4
4
  "main": "./target/build/lib.js",
5
5
  "module": "./target/build/lib.js",
6
6
  "exports": {
@@ -34,5 +34,5 @@
34
34
  "test": "tsc -p tsconfig.test.json && wtr --config ../../wtr.config.mjs --port 8002",
35
35
  "build": "tsc -p tsconfig.build.json"
36
36
  },
37
- "gitHead": "c78191a2cab50ec09abee20f688b245d235948d1"
37
+ "gitHead": "fdd5f3056615c930ea7ea4d9e790581cef8e76fc"
38
38
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Forward properties of one object to another
3
+ */
4
+ export declare function forwardProps(source: any, target: any, props: string[]): void;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Forward properties of one object to another
3
+ */
4
+ export function forwardProps(source, target, props) {
5
+ props.forEach((key) => {
6
+ target[key] = source[key];
7
+ Object.defineProperty(target, key, {
8
+ get() {
9
+ return source[key];
10
+ },
11
+ set(value) {
12
+ source[key] = value;
13
+ },
14
+ });
15
+ });
16
+ }
17
+ //# sourceMappingURL=forward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward.js","sourceRoot":"","sources":["../../../lib/forward.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAW,EAAE,MAAW,EAAE,KAAe;IACpE,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACpB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAE1B,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;YACjC,GAAG;gBACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC;YACD,GAAG,CAAC,KAAK;gBACP,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACtB,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1,2 @@
1
1
  export { observable, Change, OnChange, observe, Changes } from './lib/observable';
2
+ export { forwardProps } from './lib/forward';
@@ -1,2 +1,3 @@
1
1
  export { observable, Change, observe } from './lib/observable';
2
+ export { forwardProps } from './lib/forward';
2
3
  //# sourceMappingURL=lib.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lib.js","sourceRoot":"","sources":["../../lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAY,OAAO,EAAW,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"lib.js","sourceRoot":"","sources":["../../lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAY,OAAO,EAAW,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}