@spoosh/angular 0.6.5 → 0.8.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/README.md +2 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -4
- package/dist/index.mjs +12 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -16,15 +16,14 @@ npm install @spoosh/core @spoosh/angular
|
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { Spoosh } from "@spoosh/core";
|
|
19
|
-
import {
|
|
19
|
+
import { create } from "@spoosh/angular";
|
|
20
20
|
import { cachePlugin } from "@spoosh/plugin-cache";
|
|
21
21
|
|
|
22
22
|
const spoosh = new Spoosh<ApiSchema, Error>("/api").use([
|
|
23
23
|
cachePlugin({ staleTime: 5000 }),
|
|
24
24
|
]);
|
|
25
25
|
|
|
26
|
-
export const { injectRead, injectWrite, injectInfiniteRead } =
|
|
27
|
-
createAngularSpoosh(spoosh);
|
|
26
|
+
export const { injectRead, injectWrite, injectInfiniteRead } = create(spoosh);
|
|
28
27
|
```
|
|
29
28
|
|
|
30
29
|
### injectRead
|
package/dist/index.d.mts
CHANGED
|
@@ -359,6 +359,6 @@ type SpooshAngularFunctions<TDefaultError, TSchema, TPlugins extends PluginArray
|
|
|
359
359
|
injectInfiniteRead: ReturnType<typeof createInjectInfiniteRead<TSchema, TDefaultError, TPlugins>>;
|
|
360
360
|
} & MergePluginInstanceApi<TPlugins, TSchema>;
|
|
361
361
|
|
|
362
|
-
declare function
|
|
362
|
+
declare function create<TSchema, TDefaultError, TPlugins extends PluginArray, TApi>(instance: SpooshInstanceShape<TApi, TSchema, TDefaultError, TPlugins>): SpooshAngularFunctions<TDefaultError, TSchema, TPlugins>;
|
|
363
363
|
|
|
364
|
-
export { type AngularOptionsMap, type BaseInfiniteReadOptions, type BaseInfiniteReadResult, type BaseReadOptions, type BaseReadResult, type BaseWriteResult, type EnabledOption, type ExtractMethodBody, type ExtractMethodData, type ExtractMethodError, type ExtractMethodOptions, type ExtractMethodQuery, type ExtractResponseBody, type ExtractResponseParamNames, type ExtractResponseQuery, type InfiniteReadApiClient, type PageContext, type ReadApiClient, type ResponseInputFields, type SpooshInstanceShape, type TriggerOptions, type WriteApiClient, type WriteResponseInputFields,
|
|
364
|
+
export { type AngularOptionsMap, type BaseInfiniteReadOptions, type BaseInfiniteReadResult, type BaseReadOptions, type BaseReadResult, type BaseWriteResult, type EnabledOption, type ExtractMethodBody, type ExtractMethodData, type ExtractMethodError, type ExtractMethodOptions, type ExtractMethodQuery, type ExtractResponseBody, type ExtractResponseParamNames, type ExtractResponseQuery, type InfiniteReadApiClient, type PageContext, type ReadApiClient, type ResponseInputFields, type SpooshInstanceShape, type TriggerOptions, type WriteApiClient, type WriteResponseInputFields, create };
|
package/dist/index.d.ts
CHANGED
|
@@ -359,6 +359,6 @@ type SpooshAngularFunctions<TDefaultError, TSchema, TPlugins extends PluginArray
|
|
|
359
359
|
injectInfiniteRead: ReturnType<typeof createInjectInfiniteRead<TSchema, TDefaultError, TPlugins>>;
|
|
360
360
|
} & MergePluginInstanceApi<TPlugins, TSchema>;
|
|
361
361
|
|
|
362
|
-
declare function
|
|
362
|
+
declare function create<TSchema, TDefaultError, TPlugins extends PluginArray, TApi>(instance: SpooshInstanceShape<TApi, TSchema, TDefaultError, TPlugins>): SpooshAngularFunctions<TDefaultError, TSchema, TPlugins>;
|
|
363
363
|
|
|
364
|
-
export { type AngularOptionsMap, type BaseInfiniteReadOptions, type BaseInfiniteReadResult, type BaseReadOptions, type BaseReadResult, type BaseWriteResult, type EnabledOption, type ExtractMethodBody, type ExtractMethodData, type ExtractMethodError, type ExtractMethodOptions, type ExtractMethodQuery, type ExtractResponseBody, type ExtractResponseParamNames, type ExtractResponseQuery, type InfiniteReadApiClient, type PageContext, type ReadApiClient, type ResponseInputFields, type SpooshInstanceShape, type TriggerOptions, type WriteApiClient, type WriteResponseInputFields,
|
|
364
|
+
export { type AngularOptionsMap, type BaseInfiniteReadOptions, type BaseInfiniteReadResult, type BaseReadOptions, type BaseReadResult, type BaseWriteResult, type EnabledOption, type ExtractMethodBody, type ExtractMethodData, type ExtractMethodError, type ExtractMethodOptions, type ExtractMethodQuery, type ExtractResponseBody, type ExtractResponseParamNames, type ExtractResponseQuery, type InfiniteReadApiClient, type PageContext, type ReadApiClient, type ResponseInputFields, type SpooshInstanceShape, type TriggerOptions, type WriteApiClient, type WriteResponseInputFields, create };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
|
|
23
|
+
create: () => create
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
26
|
|
|
@@ -821,8 +821,8 @@ function createInjectInfiniteRead(options) {
|
|
|
821
821
|
};
|
|
822
822
|
}
|
|
823
823
|
|
|
824
|
-
// src/
|
|
825
|
-
function
|
|
824
|
+
// src/create/index.ts
|
|
825
|
+
function create(instance) {
|
|
826
826
|
const { api, stateManager, eventEmitter, pluginExecutor } = instance;
|
|
827
827
|
const injectRead = createInjectRead({
|
|
828
828
|
api,
|
|
@@ -842,13 +842,21 @@ function createAngularSpoosh(instance) {
|
|
|
842
842
|
eventEmitter,
|
|
843
843
|
pluginExecutor
|
|
844
844
|
});
|
|
845
|
+
const plugins = pluginExecutor.getPlugins();
|
|
846
|
+
const setupContext = {
|
|
847
|
+
stateManager,
|
|
848
|
+
eventEmitter,
|
|
849
|
+
pluginExecutor
|
|
850
|
+
};
|
|
851
|
+
for (const plugin of plugins) {
|
|
852
|
+
plugin.setup?.(setupContext);
|
|
853
|
+
}
|
|
845
854
|
const instanceApiContext = {
|
|
846
855
|
api,
|
|
847
856
|
stateManager,
|
|
848
857
|
eventEmitter,
|
|
849
858
|
pluginExecutor
|
|
850
859
|
};
|
|
851
|
-
const plugins = pluginExecutor.getPlugins();
|
|
852
860
|
const instanceApis = plugins.reduce(
|
|
853
861
|
(acc, plugin) => {
|
|
854
862
|
if (plugin.instanceApi) {
|
package/dist/index.mjs
CHANGED
|
@@ -823,8 +823,8 @@ function createInjectInfiniteRead(options) {
|
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
825
|
|
|
826
|
-
// src/
|
|
827
|
-
function
|
|
826
|
+
// src/create/index.ts
|
|
827
|
+
function create(instance) {
|
|
828
828
|
const { api, stateManager, eventEmitter, pluginExecutor } = instance;
|
|
829
829
|
const injectRead = createInjectRead({
|
|
830
830
|
api,
|
|
@@ -844,13 +844,21 @@ function createAngularSpoosh(instance) {
|
|
|
844
844
|
eventEmitter,
|
|
845
845
|
pluginExecutor
|
|
846
846
|
});
|
|
847
|
+
const plugins = pluginExecutor.getPlugins();
|
|
848
|
+
const setupContext = {
|
|
849
|
+
stateManager,
|
|
850
|
+
eventEmitter,
|
|
851
|
+
pluginExecutor
|
|
852
|
+
};
|
|
853
|
+
for (const plugin of plugins) {
|
|
854
|
+
plugin.setup?.(setupContext);
|
|
855
|
+
}
|
|
847
856
|
const instanceApiContext = {
|
|
848
857
|
api,
|
|
849
858
|
stateManager,
|
|
850
859
|
eventEmitter,
|
|
851
860
|
pluginExecutor
|
|
852
861
|
};
|
|
853
|
-
const plugins = pluginExecutor.getPlugins();
|
|
854
862
|
const instanceApis = plugins.reduce(
|
|
855
863
|
(acc, plugin) => {
|
|
856
864
|
if (plugin.instanceApi) {
|
|
@@ -868,5 +876,5 @@ function createAngularSpoosh(instance) {
|
|
|
868
876
|
};
|
|
869
877
|
}
|
|
870
878
|
export {
|
|
871
|
-
|
|
879
|
+
create
|
|
872
880
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Angular signals integration for Spoosh API toolkit",
|
|
6
6
|
"keywords": [
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@spoosh/core": ">=0.
|
|
37
|
+
"@spoosh/core": ">=0.13.0",
|
|
38
38
|
"@angular/core": ">=16.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@angular/core": "^19.0.0",
|
|
42
|
-
"@spoosh/core": "0.
|
|
43
|
-
"@spoosh/test-utils": "0.
|
|
42
|
+
"@spoosh/core": "0.13.0",
|
|
43
|
+
"@spoosh/test-utils": "0.2.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"dev": "tsup --watch",
|