imng-ngrx-utils 4.107.2 → 4.109.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/esm2020/index.mjs +2 -1
- package/esm2020/lib/get-by-id.mjs +7 -0
- package/fesm2015/imng-ngrx-utils.mjs +9 -1
- package/fesm2015/imng-ngrx-utils.mjs.map +1 -1
- package/fesm2020/imng-ngrx-utils.mjs +8 -1
- package/fesm2020/imng-ngrx-utils.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/get-by-id.d.ts +7 -0
- package/package.json +1 -1
package/esm2020/index.mjs
CHANGED
|
@@ -6,4 +6,5 @@ export { matchAndSpread } from './lib/match-and-spread';
|
|
|
6
6
|
export { removeById } from './lib/remove-by-id';
|
|
7
7
|
export { Subscriptions } from './lib/subscriptions';
|
|
8
8
|
export * from './lib/error-handler';
|
|
9
|
-
|
|
9
|
+
export * from './lib/get-by-id';
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2ltbmctbmdyeC11dGlscy9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFXLG1CQUFtQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzdELE9BQU8sRUFBRSxRQUFRLEVBQUUsT0FBTyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDbkQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3RELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNwRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDeEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVwRCxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsaUJBQWlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBQYXlsb2FkLCBjcmVhdGVQYXlsb2FkQWN0aW9uIH0gZnJvbSAnLi9saWIvcGF5bG9hZCc7XG5leHBvcnQgeyBpc1RydXRoeSwgaXNGYWxzeSB9IGZyb20gJy4vbGliL2lzVHJ1dGh5JztcbmV4cG9ydCB7IGZpbmRBbmRNb2RpZnkgfSBmcm9tICcuL2xpYi9maW5kLWFuZC1tb2RpZnknO1xuZXhwb3J0IHsgZmluZEFuZE1lcmdlIH0gZnJvbSAnLi9saWIvZmluZC1hbmQtbWVyZ2UnO1xuZXhwb3J0IHsgbWF0Y2hBbmRTcHJlYWQgfSBmcm9tICcuL2xpYi9tYXRjaC1hbmQtc3ByZWFkJztcbmV4cG9ydCB7IHJlbW92ZUJ5SWQgfSBmcm9tICcuL2xpYi9yZW1vdmUtYnktaWQnO1xuZXhwb3J0IHsgU3Vic2NyaXB0aW9ucyB9IGZyb20gJy4vbGliL3N1YnNjcmlwdGlvbnMnO1xuZXhwb3J0IHsgU3Vic2NyaWJhYmxlIH0gZnJvbSAnLi9saWIvc3Vic2NyaWJhYmxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2Vycm9yLWhhbmRsZXInO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZ2V0LWJ5LWlkJztcbiJdfQ==
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function getById(source, id) {
|
|
2
|
+
if (Array.isArray(source)) {
|
|
3
|
+
return source.find((f) => f.id === id);
|
|
4
|
+
}
|
|
5
|
+
return source.data?.find((f) => f.id === id);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0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
|
81
81
|
;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
function getById(source, id) {
|
|
85
|
+
var _a;
|
|
86
|
+
if (Array.isArray(source)) {
|
|
87
|
+
return source.find((f) => f.id === id);
|
|
88
|
+
}
|
|
89
|
+
return (_a = source.data) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === id);
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
/**
|
|
85
93
|
* Generated bundle index. Do not edit.
|
|
86
94
|
*/
|
|
87
95
|
|
|
88
|
-
export { Subscriptions, createPayloadAction, effectError, findAndMerge, findAndModify, handleEffectError, isFalsy, isTruthy, matchAndSpread, removeById };
|
|
96
|
+
export { Subscriptions, createPayloadAction, effectError, findAndMerge, findAndModify, getById, handleEffectError, isFalsy, isTruthy, matchAndSpread, removeById };
|
|
89
97
|
//# sourceMappingURL=imng-ngrx-utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imng-ngrx-utils.mjs","sources":["../../../../libs/imng-ngrx-utils/src/lib/payload.ts","../../../../libs/imng-ngrx-utils/src/lib/isTruthy.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-modify.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-merge.ts","../../../../libs/imng-ngrx-utils/src/lib/match-and-spread.ts","../../../../libs/imng-ngrx-utils/src/lib/remove-by-id.ts","../../../../libs/imng-ngrx-utils/src/lib/subscriptions.ts","../../../../libs/imng-ngrx-utils/src/lib/error-handler.ts","../../../../libs/imng-ngrx-utils/src/imng-ngrx-utils.ts"],"sourcesContent":["import { createAction } from '@ngrx/store';\n\nexport interface Payload<T> {\n payload: T;\n}\n\n// tslint:disable-next-line: typedef , doing otherwise would involve having deep imports on the @ngrx library\nexport function createPayloadAction<T>(\n actionType: string,\n) {\n return createAction(actionType, (payload: T) => ({ payload }));\n}\n","export function isTruthy(value: unknown): boolean {\n return !!value;\n}\n\nexport function isFalsy(value: unknown): boolean {\n return !value;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndModify<ENTITY extends { id?: IdType }>(\n data: ENTITY[],\n lookupId: IdType,\n modificationLogic: (matchingRecord: ENTITY) => void,\n): ENTITY[] {\n return [...data.map((m) => (m.id === lookupId ? applyChanges(m, modificationLogic) : m))];\n}\n\nfunction applyChanges<ENTITY>(record: ENTITY, modificationLogic: (matchingRecord: ENTITY) => void): ENTITY {\n const spreadRecord = { ...record };\n modificationLogic(spreadRecord);\n return spreadRecord;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndMerge<ENTITY extends { id?: IdType }, COLLECTION_ENTITY extends { id?: IdType }>(\n record: ENTITY,\n data: COLLECTION_ENTITY[],\n): ENTITY {\n return {\n ...data.find((f) => f.id === record.id),\n ...record,\n };\n}\n","import { findAndMerge } from './find-and-merge';\nimport { IdType } from 'imng-nrsrx-client-utils';\n/**\n * Spreads the objects in the dataset1, with a matching id object from the dataset2.\n * @param dataset1 The original dataset, these are the records you can expect to get back.\n * @param dataset2 This dataset will be used to augment the individuals records in dataSet1, records will be matched based on 'id'.\n * @returns dataset1\n */\nexport function matchAndSpread<ENTITY1 extends { id?: IdType }, ENTITY2 extends { id?: IdType }>(\n dataset1: ENTITY1[],\n dataset2: ENTITY2[],\n): ENTITY1[] {\n return dataset1.map((d1) => findAndMerge(d1, dataset2));\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function removeById<T extends { id?: IdType; }>(\n source: { data: T[]; total: number; } | Array<T>,\n id: IdType,\n): { data: T[]; total: number; } | Array<T> | null {\n if (Array.isArray(source)) {\n const result = source;\n return result?.filter((f) => f.id !== id);\n } else if (source) {\n const data = source.data?.filter((f) => f.id !== id);\n return {\n total: source.total + (data?.length - source.data?.length) || 0,\n data,\n };\n }\n return null;\n}\n","import { Subscription } from 'rxjs';\n\nexport class Subscriptions {\n private readonly _subscriptions: (Subscription | undefined)[];\n\n public constructor(...items: Subscription[]) {\n this._subscriptions = items;\n }\n public get length(): number {\n return this._subscriptions.length;\n }\n\n public push(...items: (Subscription | undefined)[]): void {\n this._subscriptions.push(...items.filter((t) => t));\n }\n public forEach(\n callbackfn: (\n value: Subscription,\n index: number,\n array: Subscription[]\n ) => void,\n thisArg?: unknown\n ): void {\n this._subscriptions\n .map((t) => t as Subscription)\n .forEach(callbackfn, thisArg);\n }\n\n public unsubscribeAll(): void {\n while (this._subscriptions.length > 0) {\n const val = this._subscriptions.pop();\n val?.unsubscribe();\n }\n }\n}\n","import { Action } from '@ngrx/store';\nimport { catchError, of, OperatorFunction } from 'rxjs';\nimport { createPayloadAction } from './payload';\n\nexport const effectError = createPayloadAction<{ action: Action, error: Error; }>(\n '[IMNG] Error Occured');\n\nexport function handleEffectError(action: Action): OperatorFunction<Action, Action> {\n return catchError((error) => of(effectError({ action, error })));;\n} \n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAMA;AACM,SAAU,mBAAmB,CACjC,UAAkB,EAAA;AAElB,IAAA,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC,OAAU,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACjE;;ACXM,SAAU,QAAQ,CAAC,KAAc,EAAA;IACrC,OAAO,CAAC,CAAC,KAAK,CAAC;AACjB,CAAC;AAEK,SAAU,OAAO,CAAC,KAAc,EAAA;IACpC,OAAO,CAAC,KAAK,CAAC;AAChB;;SCJgB,aAAa,CAC3B,IAAc,EACd,QAAgB,EAChB,iBAAmD,EAAA;AAEnD,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,QAAQ,GAAG,YAAY,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,SAAS,YAAY,CAAS,MAAc,EAAE,iBAAmD,EAAA;AAC/F,IAAA,MAAM,YAAY,GAAA,MAAA,CAAA,MAAA,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pE;;
|
|
1
|
+
{"version":3,"file":"imng-ngrx-utils.mjs","sources":["../../../../libs/imng-ngrx-utils/src/lib/payload.ts","../../../../libs/imng-ngrx-utils/src/lib/isTruthy.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-modify.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-merge.ts","../../../../libs/imng-ngrx-utils/src/lib/match-and-spread.ts","../../../../libs/imng-ngrx-utils/src/lib/remove-by-id.ts","../../../../libs/imng-ngrx-utils/src/lib/subscriptions.ts","../../../../libs/imng-ngrx-utils/src/lib/error-handler.ts","../../../../libs/imng-ngrx-utils/src/lib/get-by-id.ts","../../../../libs/imng-ngrx-utils/src/imng-ngrx-utils.ts"],"sourcesContent":["import { createAction } from '@ngrx/store';\n\nexport interface Payload<T> {\n payload: T;\n}\n\n// tslint:disable-next-line: typedef , doing otherwise would involve having deep imports on the @ngrx library\nexport function createPayloadAction<T>(\n actionType: string,\n) {\n return createAction(actionType, (payload: T) => ({ payload }));\n}\n","export function isTruthy(value: unknown): boolean {\n return !!value;\n}\n\nexport function isFalsy(value: unknown): boolean {\n return !value;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndModify<ENTITY extends { id?: IdType }>(\n data: ENTITY[],\n lookupId: IdType,\n modificationLogic: (matchingRecord: ENTITY) => void,\n): ENTITY[] {\n return [...data.map((m) => (m.id === lookupId ? applyChanges(m, modificationLogic) : m))];\n}\n\nfunction applyChanges<ENTITY>(record: ENTITY, modificationLogic: (matchingRecord: ENTITY) => void): ENTITY {\n const spreadRecord = { ...record };\n modificationLogic(spreadRecord);\n return spreadRecord;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndMerge<ENTITY extends { id?: IdType }, COLLECTION_ENTITY extends { id?: IdType }>(\n record: ENTITY,\n data: COLLECTION_ENTITY[],\n): ENTITY {\n return {\n ...data.find((f) => f.id === record.id),\n ...record,\n };\n}\n","import { findAndMerge } from './find-and-merge';\nimport { IdType } from 'imng-nrsrx-client-utils';\n/**\n * Spreads the objects in the dataset1, with a matching id object from the dataset2.\n * @param dataset1 The original dataset, these are the records you can expect to get back.\n * @param dataset2 This dataset will be used to augment the individuals records in dataSet1, records will be matched based on 'id'.\n * @returns dataset1\n */\nexport function matchAndSpread<ENTITY1 extends { id?: IdType }, ENTITY2 extends { id?: IdType }>(\n dataset1: ENTITY1[],\n dataset2: ENTITY2[],\n): ENTITY1[] {\n return dataset1.map((d1) => findAndMerge(d1, dataset2));\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function removeById<T extends { id?: IdType; }>(\n source: { data: T[]; total: number; } | Array<T>,\n id: IdType,\n): { data: T[]; total: number; } | Array<T> | null {\n if (Array.isArray(source)) {\n const result = source;\n return result?.filter((f) => f.id !== id);\n } else if (source) {\n const data = source.data?.filter((f) => f.id !== id);\n return {\n total: source.total + (data?.length - source.data?.length) || 0,\n data,\n };\n }\n return null;\n}\n","import { Subscription } from 'rxjs';\n\nexport class Subscriptions {\n private readonly _subscriptions: (Subscription | undefined)[];\n\n public constructor(...items: Subscription[]) {\n this._subscriptions = items;\n }\n public get length(): number {\n return this._subscriptions.length;\n }\n\n public push(...items: (Subscription | undefined)[]): void {\n this._subscriptions.push(...items.filter((t) => t));\n }\n public forEach(\n callbackfn: (\n value: Subscription,\n index: number,\n array: Subscription[]\n ) => void,\n thisArg?: unknown\n ): void {\n this._subscriptions\n .map((t) => t as Subscription)\n .forEach(callbackfn, thisArg);\n }\n\n public unsubscribeAll(): void {\n while (this._subscriptions.length > 0) {\n const val = this._subscriptions.pop();\n val?.unsubscribe();\n }\n }\n}\n","import { Action } from '@ngrx/store';\nimport { catchError, of, OperatorFunction } from 'rxjs';\nimport { createPayloadAction } from './payload';\n\nexport const effectError = createPayloadAction<{ action: Action, error: Error; }>(\n '[IMNG] Error Occured');\n\nexport function handleEffectError(action: Action): OperatorFunction<Action, Action> {\n return catchError((error) => of(effectError({ action, error })));;\n} \n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function getById<T extends { id?: IdType; }>(\n source: { data: T[]; total: number; } | Array<T>,\n id: IdType,\n): T | undefined {\n if (Array.isArray(source)) {\n return source.find((f) => f.id === id);\n }\n return source.data?.find((f) => f.id === id);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAMA;AACM,SAAU,mBAAmB,CACjC,UAAkB,EAAA;AAElB,IAAA,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC,OAAU,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACjE;;ACXM,SAAU,QAAQ,CAAC,KAAc,EAAA;IACrC,OAAO,CAAC,CAAC,KAAK,CAAC;AACjB,CAAC;AAEK,SAAU,OAAO,CAAC,KAAc,EAAA;IACpC,OAAO,CAAC,KAAK,CAAC;AAChB;;SCJgB,aAAa,CAC3B,IAAc,EACd,QAAgB,EAChB,iBAAmD,EAAA;AAEnD,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,QAAQ,GAAG,YAAY,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,SAAS,YAAY,CAAS,MAAc,EAAE,iBAAmD,EAAA;AAC/F,IAAA,MAAM,YAAY,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,MAAM,CAAE,CAAC;IACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAChC,IAAA,OAAO,YAAY,CAAC;AACtB;;ACZgB,SAAA,YAAY,CAC1B,MAAc,EACd,IAAyB,EAAA;AAEzB,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,CAAA,EACpC,MAAM,C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AAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/C;;ACVA;;AAEG;;;;"}
|
|
@@ -83,9 +83,16 @@ function handleEffectError(action) {
|
|
|
83
83
|
;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
function getById(source, id) {
|
|
87
|
+
if (Array.isArray(source)) {
|
|
88
|
+
return source.find((f) => f.id === id);
|
|
89
|
+
}
|
|
90
|
+
return source.data?.find((f) => f.id === id);
|
|
91
|
+
}
|
|
92
|
+
|
|
86
93
|
/**
|
|
87
94
|
* Generated bundle index. Do not edit.
|
|
88
95
|
*/
|
|
89
96
|
|
|
90
|
-
export { Subscriptions, createPayloadAction, effectError, findAndMerge, findAndModify, handleEffectError, isFalsy, isTruthy, matchAndSpread, removeById };
|
|
97
|
+
export { Subscriptions, createPayloadAction, effectError, findAndMerge, findAndModify, getById, handleEffectError, isFalsy, isTruthy, matchAndSpread, removeById };
|
|
91
98
|
//# sourceMappingURL=imng-ngrx-utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imng-ngrx-utils.mjs","sources":["../../../../libs/imng-ngrx-utils/src/lib/payload.ts","../../../../libs/imng-ngrx-utils/src/lib/isTruthy.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-modify.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-merge.ts","../../../../libs/imng-ngrx-utils/src/lib/match-and-spread.ts","../../../../libs/imng-ngrx-utils/src/lib/remove-by-id.ts","../../../../libs/imng-ngrx-utils/src/lib/subscriptions.ts","../../../../libs/imng-ngrx-utils/src/lib/error-handler.ts","../../../../libs/imng-ngrx-utils/src/imng-ngrx-utils.ts"],"sourcesContent":["import { createAction } from '@ngrx/store';\n\nexport interface Payload<T> {\n payload: T;\n}\n\n// tslint:disable-next-line: typedef , doing otherwise would involve having deep imports on the @ngrx library\nexport function createPayloadAction<T>(\n actionType: string,\n) {\n return createAction(actionType, (payload: T) => ({ payload }));\n}\n","export function isTruthy(value: unknown): boolean {\n return !!value;\n}\n\nexport function isFalsy(value: unknown): boolean {\n return !value;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndModify<ENTITY extends { id?: IdType }>(\n data: ENTITY[],\n lookupId: IdType,\n modificationLogic: (matchingRecord: ENTITY) => void,\n): ENTITY[] {\n return [...data.map((m) => (m.id === lookupId ? applyChanges(m, modificationLogic) : m))];\n}\n\nfunction applyChanges<ENTITY>(record: ENTITY, modificationLogic: (matchingRecord: ENTITY) => void): ENTITY {\n const spreadRecord = { ...record };\n modificationLogic(spreadRecord);\n return spreadRecord;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndMerge<ENTITY extends { id?: IdType }, COLLECTION_ENTITY extends { id?: IdType }>(\n record: ENTITY,\n data: COLLECTION_ENTITY[],\n): ENTITY {\n return {\n ...data.find((f) => f.id === record.id),\n ...record,\n };\n}\n","import { findAndMerge } from './find-and-merge';\nimport { IdType } from 'imng-nrsrx-client-utils';\n/**\n * Spreads the objects in the dataset1, with a matching id object from the dataset2.\n * @param dataset1 The original dataset, these are the records you can expect to get back.\n * @param dataset2 This dataset will be used to augment the individuals records in dataSet1, records will be matched based on 'id'.\n * @returns dataset1\n */\nexport function matchAndSpread<ENTITY1 extends { id?: IdType }, ENTITY2 extends { id?: IdType }>(\n dataset1: ENTITY1[],\n dataset2: ENTITY2[],\n): ENTITY1[] {\n return dataset1.map((d1) => findAndMerge(d1, dataset2));\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function removeById<T extends { id?: IdType; }>(\n source: { data: T[]; total: number; } | Array<T>,\n id: IdType,\n): { data: T[]; total: number; } | Array<T> | null {\n if (Array.isArray(source)) {\n const result = source;\n return result?.filter((f) => f.id !== id);\n } else if (source) {\n const data = source.data?.filter((f) => f.id !== id);\n return {\n total: source.total + (data?.length - source.data?.length) || 0,\n data,\n };\n }\n return null;\n}\n","import { Subscription } from 'rxjs';\n\nexport class Subscriptions {\n private readonly _subscriptions: (Subscription | undefined)[];\n\n public constructor(...items: Subscription[]) {\n this._subscriptions = items;\n }\n public get length(): number {\n return this._subscriptions.length;\n }\n\n public push(...items: (Subscription | undefined)[]): void {\n this._subscriptions.push(...items.filter((t) => t));\n }\n public forEach(\n callbackfn: (\n value: Subscription,\n index: number,\n array: Subscription[]\n ) => void,\n thisArg?: unknown\n ): void {\n this._subscriptions\n .map((t) => t as Subscription)\n .forEach(callbackfn, thisArg);\n }\n\n public unsubscribeAll(): void {\n while (this._subscriptions.length > 0) {\n const val = this._subscriptions.pop();\n val?.unsubscribe();\n }\n }\n}\n","import { Action } from '@ngrx/store';\nimport { catchError, of, OperatorFunction } from 'rxjs';\nimport { createPayloadAction } from './payload';\n\nexport const effectError = createPayloadAction<{ action: Action, error: Error; }>(\n '[IMNG] Error Occured');\n\nexport function handleEffectError(action: Action): OperatorFunction<Action, Action> {\n return catchError((error) => of(effectError({ action, error })));;\n} \n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAMA;AACM,SAAU,mBAAmB,CACjC,UAAkB,EAAA;AAElB,IAAA,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC,OAAU,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACjE;;ACXM,SAAU,QAAQ,CAAC,KAAc,EAAA;IACrC,OAAO,CAAC,CAAC,KAAK,CAAC;AACjB,CAAC;AAEK,SAAU,OAAO,CAAC,KAAc,EAAA;IACpC,OAAO,CAAC,KAAK,CAAC;AAChB;;SCJgB,aAAa,CAC3B,IAAc,EACd,QAAgB,EAChB,iBAAmD,EAAA;AAEnD,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,QAAQ,GAAG,YAAY,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AA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AA,WAAA,CAAmB,GAAG,KAAqB,EAAA;AACzC,QAAA,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC7B;AACD,IAAA,IAAW,MAAM,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;KACnC;IAEM,IAAI,CAAC,GAAG,KAAmC,EAAA;AAChD,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACrD;IACM,OAAO,CACZ,UAIS,EACT,OAAiB,EAAA;AAEjB,QAAA,IAAI,CAAC,cAAc;AAChB,aAAA,GAAG,CAAC,CAAC,CAAC,KAAK,CAAiB,CAAC;AAC7B,aAAA,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KACjC;IAEM,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YACrC,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;YACtC,GAAG,EAAE,WAAW,EAAE,CAAC;AACpB,SAAA;KACF;AACF;;MC9BY,WAAW,GAAG,mBAAmB,CAC5C,sBAAsB,EAAE;AAEpB,SAAU,iBAAiB,CAAC,MAAc,EAAA;AAC9C,IAAA,OAAO,UAAU,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAAA,CAAC;AACpE;;
|
|
1
|
+
{"version":3,"file":"imng-ngrx-utils.mjs","sources":["../../../../libs/imng-ngrx-utils/src/lib/payload.ts","../../../../libs/imng-ngrx-utils/src/lib/isTruthy.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-modify.ts","../../../../libs/imng-ngrx-utils/src/lib/find-and-merge.ts","../../../../libs/imng-ngrx-utils/src/lib/match-and-spread.ts","../../../../libs/imng-ngrx-utils/src/lib/remove-by-id.ts","../../../../libs/imng-ngrx-utils/src/lib/subscriptions.ts","../../../../libs/imng-ngrx-utils/src/lib/error-handler.ts","../../../../libs/imng-ngrx-utils/src/lib/get-by-id.ts","../../../../libs/imng-ngrx-utils/src/imng-ngrx-utils.ts"],"sourcesContent":["import { createAction } from '@ngrx/store';\n\nexport interface Payload<T> {\n payload: T;\n}\n\n// tslint:disable-next-line: typedef , doing otherwise would involve having deep imports on the @ngrx library\nexport function createPayloadAction<T>(\n actionType: string,\n) {\n return createAction(actionType, (payload: T) => ({ payload }));\n}\n","export function isTruthy(value: unknown): boolean {\n return !!value;\n}\n\nexport function isFalsy(value: unknown): boolean {\n return !value;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndModify<ENTITY extends { id?: IdType }>(\n data: ENTITY[],\n lookupId: IdType,\n modificationLogic: (matchingRecord: ENTITY) => void,\n): ENTITY[] {\n return [...data.map((m) => (m.id === lookupId ? applyChanges(m, modificationLogic) : m))];\n}\n\nfunction applyChanges<ENTITY>(record: ENTITY, modificationLogic: (matchingRecord: ENTITY) => void): ENTITY {\n const spreadRecord = { ...record };\n modificationLogic(spreadRecord);\n return spreadRecord;\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function findAndMerge<ENTITY extends { id?: IdType }, COLLECTION_ENTITY extends { id?: IdType }>(\n record: ENTITY,\n data: COLLECTION_ENTITY[],\n): ENTITY {\n return {\n ...data.find((f) => f.id === record.id),\n ...record,\n };\n}\n","import { findAndMerge } from './find-and-merge';\nimport { IdType } from 'imng-nrsrx-client-utils';\n/**\n * Spreads the objects in the dataset1, with a matching id object from the dataset2.\n * @param dataset1 The original dataset, these are the records you can expect to get back.\n * @param dataset2 This dataset will be used to augment the individuals records in dataSet1, records will be matched based on 'id'.\n * @returns dataset1\n */\nexport function matchAndSpread<ENTITY1 extends { id?: IdType }, ENTITY2 extends { id?: IdType }>(\n dataset1: ENTITY1[],\n dataset2: ENTITY2[],\n): ENTITY1[] {\n return dataset1.map((d1) => findAndMerge(d1, dataset2));\n}\n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function removeById<T extends { id?: IdType; }>(\n source: { data: T[]; total: number; } | Array<T>,\n id: IdType,\n): { data: T[]; total: number; } | Array<T> | null {\n if (Array.isArray(source)) {\n const result = source;\n return result?.filter((f) => f.id !== id);\n } else if (source) {\n const data = source.data?.filter((f) => f.id !== id);\n return {\n total: source.total + (data?.length - source.data?.length) || 0,\n data,\n };\n }\n return null;\n}\n","import { Subscription } from 'rxjs';\n\nexport class Subscriptions {\n private readonly _subscriptions: (Subscription | undefined)[];\n\n public constructor(...items: Subscription[]) {\n this._subscriptions = items;\n }\n public get length(): number {\n return this._subscriptions.length;\n }\n\n public push(...items: (Subscription | undefined)[]): void {\n this._subscriptions.push(...items.filter((t) => t));\n }\n public forEach(\n callbackfn: (\n value: Subscription,\n index: number,\n array: Subscription[]\n ) => void,\n thisArg?: unknown\n ): void {\n this._subscriptions\n .map((t) => t as Subscription)\n .forEach(callbackfn, thisArg);\n }\n\n public unsubscribeAll(): void {\n while (this._subscriptions.length > 0) {\n const val = this._subscriptions.pop();\n val?.unsubscribe();\n }\n }\n}\n","import { Action } from '@ngrx/store';\nimport { catchError, of, OperatorFunction } from 'rxjs';\nimport { createPayloadAction } from './payload';\n\nexport const effectError = createPayloadAction<{ action: Action, error: Error; }>(\n '[IMNG] Error Occured');\n\nexport function handleEffectError(action: Action): OperatorFunction<Action, Action> {\n return catchError((error) => of(effectError({ action, error })));;\n} \n","import { IdType } from 'imng-nrsrx-client-utils';\n\nexport function getById<T extends { id?: IdType; }>(\n source: { data: T[]; total: number; } | Array<T>,\n id: IdType,\n): T | undefined {\n if (Array.isArray(source)) {\n return source.find((f) => f.id === id);\n }\n return source.data?.find((f) => f.id === id);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAMA;AACM,SAAU,mBAAmB,CACjC,UAAkB,EAA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