@axman/remote 0.0.1 → 0.0.2
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/dist/all.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
package/dist/all.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { Remote } from './remote';
|
|
|
2
2
|
type RemoteDataList<RemoteList extends readonly Remote<unknown>[]> = {
|
|
3
3
|
[K in keyof RemoteList]: RemoteList[K] extends Remote<infer D> ? D : never;
|
|
4
4
|
};
|
|
5
|
-
export declare function all<RemoteList extends readonly Remote<unknown>[]>(
|
|
5
|
+
export declare function all<RemoteList extends readonly Remote<unknown>[]>(values: RemoteList): Remote<RemoteDataList<RemoteList>>;
|
|
6
6
|
export {};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(){return{status:"pending",isPending:!0,isError:!1,isSuccess:!1,error:void 0,data:void 0}}function i(r){return{status:"error",isPending:!1,isError:!0,isSuccess:!1,error:r,data:null}}function u(r){return{status:"success",isPending:!1,isError:!1,isSuccess:!0,error:null,data:r}}function c(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(){return{status:"pending",isPending:!0,isError:!1,isSuccess:!1,error:void 0,data:void 0}}function i(r){return{status:"error",isPending:!1,isError:!0,isSuccess:!1,error:r,data:null}}function u(r){return{status:"success",isPending:!1,isError:!1,isSuccess:!0,error:null,data:r}}function c(r){let e=!1;for(const n of r){if(n.isError)return i(n.error);n.isPending&&(e=!0)}if(e)return t();const s=r.map(n=>n.data);return u(s)}function o(r,e){switch(r.status){case"pending":return e.pending();case"error":return e.error(r.error);case"success":return e.success(r.data)}}function a(r,e){return o(r,{pending:()=>t(),error:s=>i(s),success:s=>u(e(s))})}const d=Object.freeze(Object.defineProperty({__proto__:null,all:c,error:i,map:a,match:o,pending:t,success:u},Symbol.toStringTag,{value:"Module"}));exports.all=c;exports.error=i;exports.map=a;exports.match=o;exports.pending=t;exports.remote=d;exports.success=u;
|
package/dist/index.es.js
CHANGED