-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
28 lines (26 loc) · 897 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Plugin, StoreAggregateTrigger, Step } from "@shanzhai/interfaces";
import { zipContentStore } from "@shanzhai/zip-content-store";
import { zipStore } from "@shanzhai/zip-store";
import { ZipStep } from "@shanzhai/zip-step";
import { KeyedStoreGetAllInput } from "@shanzhai/keyed-store-get-all-input";
import { UnkeyedStoreSetOutput } from "@shanzhai/unkeyed-store-set-output";
import { MergeObjectInput } from "@shanzhai/merge-object-input";
const zipPlugin: Plugin<{
readonly zip: StoreAggregateTrigger;
}> = {
triggers: {
zip: {
type: `storeAggregate`,
stores: [zipContentStore],
invalidated(): Step {
return new ZipStep(
`Zip`,
new MergeObjectInput(new KeyedStoreGetAllInput(zipContentStore)),
new UnkeyedStoreSetOutput(zipStore)
);
},
writesToStores: [zipStore],
},
},
};
export = zipPlugin;