@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 +9 -0
- package/package.json +1 -1
- package/src/lib/promise/index.d.ts +1 -0
- package/src/lib/promise/index.js +1 -0
- package/src/lib/promise/index.js.map +1 -1
- package/src/lib/promise/use.d.ts +14 -0
- package/src/lib/promise/use.js +16 -0
- package/src/lib/promise/use.js.map +1 -0
- package/test/CHANGELOG.md +4 -0
- package/test/package.json +2 -2
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
package/src/lib/promise/index.js
CHANGED
|
@@ -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": "
|
|
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": "
|
|
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"
|