Skip to content

Commit

Permalink
refactor: small improvement to some type cases where any was required
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Guerrero committed Apr 22, 2024
1 parent dc2858d commit d690a48
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,13 @@ export function withEntitiesLocalFilter<
entity?: Entity;
collection?: Collection;
}): SignalStoreFeature<
// TODO: the problem seems be with the state pro, when set to any
// it works but is it has a namedstate it doesnt
// TODO: we have a problem with the state property, when set to string
// it works but is it has a Collection, some methods are not generated, it seems
// to only be accessible using store['filterEntities']
// the workaround doesn't cause any issues, because the signals prop does work and still
// gives the right error requiring withEntities to be used
{
state: NamedEntityState<Entity, any>;
state: NamedEntityState<Entity, string>;
signals: NamedEntitySignals<Entity, Collection>;
methods: {};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function withEntitiesLocalPagination<
collection?: Collection;
}): SignalStoreFeature<
{
state: NamedEntityState<Entity, any>; // if put Collection the some props get lost and can only be access ['prop'] weird bug
state: NamedEntityState<Entity, string>; // if put Collection the some props get lost and can only be access ['prop'] weird bug
signals: NamedEntitySignals<Entity, Collection>;
methods: {};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export function withEntitiesRemotePagination<
collection?: Collection;
}): SignalStoreFeature<
{
state: NamedEntityState<Entity, any>; // if put Collection the some props get lost and can only be access ['prop'] weird bug
state: NamedEntityState<Entity, string>; // if put Collection the some props get lost and can only be access ['prop'] weird bug
signals: NamedEntitySignals<Entity, Collection> &
NamedCallStatusComputed<Collection>;
methods: NamedCallStatusMethods<Collection>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export function withEntitiesRemoteScrollPagination<
collection?: Collection;
}): SignalStoreFeature<
{
state: NamedEntityState<Entity, any>; // if put Collection the some props get lost and can only be access ['prop'] weird bug
state: NamedEntityState<Entity, string>; // if put Collection the some props get lost and can only be access ['prop'] weird bug
signals: NamedEntitySignals<Entity, Collection> &
NamedCallStatusComputed<Collection>;
methods: NamedCallStatusMethods<Collection>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ export function withEntitiesLocalSort<
entity?: Entity;
collection?: Collection;
}): SignalStoreFeature<
// TODO: the problem seems be with the state pro, when set to empty
// it works but is it has a namedstate it doesnt
// TODO: we have a problem with the state property, when set to string
// it works but is it has a Collection, some methods are not generated, it seems
// to only be accessible using store['filterEntities']
// the workaround doesn't cause any issues, because the signals prop does work and still
// gives the right error requiring withEntities to be used
{
state: NamedEntityState<Entity, any>;
state: NamedEntityState<Entity, string>;
signals: NamedEntitySignals<Entity, Collection>;
methods: {};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function withEntitiesRemoteSort<
collection?: Collection;
}): SignalStoreFeature<
{
state: NamedEntityState<Entity, any>;
state: NamedEntityState<Entity, string>;
signals: NamedEntitySignals<Entity, Collection>;
methods: NamedCallStatusMethods<Collection>;
},
Expand Down

0 comments on commit d690a48

Please sign in to comment.