Skip to content

Commit

Permalink
feat(signals): add models for building advanced features to the publi…
Browse files Browse the repository at this point in the history
…c API

Closes #4272
  • Loading branch information
markostanimirovic committed Jul 19, 2024
1 parent 52793fe commit bdc2c48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 4 additions & 3 deletions modules/signals/entities/src/with-entities.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { computed, Signal } from '@angular/core';
import {
EmptyFeatureResult,
SignalStoreFeature,
signalStoreFeature,
withComputed,
Expand All @@ -16,7 +17,7 @@ import {
import { getEntityStateKeys } from './helpers';

export function withEntities<Entity>(): SignalStoreFeature<
{ state: {}; computed: {}; methods: {} },
EmptyFeatureResult,
{
state: EntityState<Entity>;
computed: EntityComputed<Entity>;
Expand All @@ -27,7 +28,7 @@ export function withEntities<Entity, Collection extends string>(config: {
entity: Entity;
collection: Collection;
}): SignalStoreFeature<
{ state: {}; computed: {}; methods: {} },
EmptyFeatureResult,
{
state: NamedEntityState<Entity, Collection>;
computed: NamedEntityComputed<Entity, Collection>;
Expand All @@ -37,7 +38,7 @@ export function withEntities<Entity, Collection extends string>(config: {
export function withEntities<Entity>(config: {
entity: Entity;
}): SignalStoreFeature<
{ state: {}; computed: {}; methods: {} },
EmptyFeatureResult,
{
state: EntityState<Entity>;
computed: EntityComputed<Entity>;
Expand Down
8 changes: 7 additions & 1 deletion modules/signals/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ export { DeepSignal } from './deep-signal';
export { signalState, SignalState } from './signal-state';
export { signalStore } from './signal-store';
export { signalStoreFeature, type } from './signal-store-feature';
export { SignalStoreFeature } from './signal-store-models';
export {
EmptyFeatureResult,
SignalStoreFeature,
SignalStoreFeatureResult,
StateSignals,
} from './signal-store-models';
export {
getState,
PartialStateUpdater,
patchState,
StateSource,
WritableStateSource,
} from './state-source';
export { Prettify } from './ts-helpers';

export { withComputed } from './with-computed';
export { withHooks } from './with-hooks';
Expand Down

0 comments on commit bdc2c48

Please sign in to comment.