@dereekb/util 6.0.0 → 7.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [7.0.0](https://github.com/dereekb/dbx-components/compare/v6.0.0-dev...v7.0.0) (2022-06-05)
6
+
7
+
8
+ ### Features
9
+
10
+ * added useModel to AbstractFirebaseNestContext ([29c1940](https://github.com/dereekb/dbx-components/commit/29c19402bff78d743d28ef88093757844f8ee5f7))
11
+
12
+
13
+
5
14
  # [6.0.0](https://github.com/dereekb/dbx-components/compare/v5.3.0-dev...v6.0.0) (2022-06-03)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "type": "commonjs",
5
5
  "exports": {
6
6
  ".": {
@@ -5,3 +5,4 @@ export * from './promise';
5
5
  export * from './promise.loop';
6
6
  export * from './promise.ref';
7
7
  export * from './wait';
8
+ export * from './use';
@@ -8,4 +8,5 @@ tslib_1.__exportStar(require("./promise"), exports);
8
8
  tslib_1.__exportStar(require("./promise.loop"), exports);
9
9
  tslib_1.__exportStar(require("./promise.ref"), exports);
10
10
  tslib_1.__exportStar(require("./wait"), exports);
11
+ tslib_1.__exportStar(require("./use"), exports);
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/promise/index.ts"],"names":[],"mappings":";;;AAAA,+CAAqB;AACrB,iDAAuB;AACvB,gDAAsB;AACtB,oDAA0B;AAC1B,yDAA+B;AAC/B,wDAA8B;AAC9B,iDAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/promise/index.ts"],"names":[],"mappings":";;;AAAA,+CAAqB;AACrB,iDAAuB;AACvB,gDAAsB;AACtB,oDAA0B;AAC1B,yDAA+B;AAC/B,wDAA8B;AAC9B,iDAAuB;AACvB,gDAAsB"}
@@ -0,0 +1,14 @@
1
+ import { GetterOrValue } from '../getter';
2
+ import { PromiseOrValue } from './promise';
3
+ export declare type UsePromiseUseFunction<I, O> = (value: I) => PromiseOrValue<O>;
4
+ /**
5
+ * Uses a value returned from a promise.
6
+ */
7
+ export declare type UsePromiseFunction<I> = <O>(useFn: UsePromiseUseFunction<I, O>) => Promise<O>;
8
+ /**
9
+ * Creates a UsePromiseFactory.
10
+ *
11
+ * @param input
12
+ * @returns
13
+ */
14
+ export declare function usePromise<I>(input: GetterOrValue<Promise<I>>): UsePromiseFunction<I>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePromise = void 0;
4
+ const getter_1 = require("../getter");
5
+ /**
6
+ * Creates a UsePromiseFactory.
7
+ *
8
+ * @param input
9
+ * @returns
10
+ */
11
+ function usePromise(input) {
12
+ const _getter = (0, getter_1.asGetter)(input);
13
+ return (useFn) => _getter().then(useFn);
14
+ }
15
+ exports.usePromise = usePromise;
16
+ //# sourceMappingURL=use.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/promise/use.ts"],"names":[],"mappings":";;;AAAA,sCAAoD;AAUpD;;;;;GAKG;AACH,SAAgB,UAAU,CAAI,KAAgC;IAC5D,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,KAAK,CAAC,CAAC;IAChC,OAAO,CAAI,KAAkC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAe,CAAC;AACxF,CAAC;AAHD,gCAGC"}
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [7.0.0](https://github.com/dereekb/dbx-components/compare/v6.0.0-dev...v7.0.0) (2022-06-05)
6
+
7
+
8
+
5
9
  # [6.0.0](https://github.com/dereekb/dbx-components/compare/v5.3.0-dev...v6.0.0) (2022-06-03)
6
10
 
7
11
 
package/test/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "main": "./src/index.js",
5
5
  "typings": "./src/index.d.ts",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {
8
- "@dereekb/util": "6.0.0",
8
+ "@dereekb/util": "7.0.0",
9
9
  "make-error": "^1.3.0",
10
10
  "extra-set": "^2.2.11",
11
11
  "tslib": "^2.0.0"