Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

0.2 #26

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

0.2 #26

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"type": "commonjs",
"peerDependencies": {
"effector": "^22.5.0"
},
"dependencies": {
"ts-toolbelt": "^9.6.0"
}
}
4 changes: 2 additions & 2 deletions packages/core/src/createComputedField.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { combine } from 'effector';
import type { Aggregate, ListApi, Selection, PossibleKey } from './types';
import type { Aggregate, ListApi, PossibleKey, SelectionApi } from './types';

import { createGroup } from './createGroup';

Expand All @@ -20,7 +20,7 @@ export function createComputedField<
aggregateField: AggregateField;
fn: (items: Item[], groupID: Item[AggregateField]) => Aggregation;
when?: (item: Item, groupID: Item[AggregateField]) => boolean;
selection?: Selection<Item, Key>;
selection?: SelectionApi<Item, Key>;
defaultValue: Aggregation;
}): Aggregate<Item, Key, AggregateField, Aggregation> {
const index = selection
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/createGroup.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { ListApi, Selection, IndexApi, PossibleKey } from './types';
import { addAlwaysActivatedConsumer } from './consumerPort';
import type { IndexApi, ListApi, PossibleKey, SelectionApi } from './types';

export function createGroup<
Item,
Key extends PossibleKey,
Field extends keyof Item
>(args: {
field: Field;
selection: Selection<Item, Key>;
selection: SelectionApi<Item, Key>;
}): IndexApi<Item, Key, Field>;
export function createGroup<
Item,
Expand All @@ -25,7 +25,7 @@ export function createGroup<
}: {
kv?: ListApi<Item, Key>;
field: Field;
selection?: Selection<Item, Key>;
selection?: SelectionApi<Item, Key>;
}): IndexApi<Item, Key, Field> {
if (!kv && !selection) {
throw new Error(`Can't create index without kv or selection`);
Expand Down
Loading