Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(signal-slice): prevent early inference in selector typing #214

Merged

Conversation

joshuamorony
Copy link
Contributor

fixes #213

Since the selectors are passed the entire SignalSlice it will infer all of the types for actionSources/actionEffects etc when the selectors config is passed in (at which time those other configurations have not been supplied yet).

I've made a typing change so that rather than being passed the entire SignalSlice the selectors and others are only passed the subset of types that they actually need, e.g SelectorsState and EffectsState:

type SelectorsState<TSignalValue extends NoOptionalProperties<TSignalValue>> =
	Signal<TSignalValue> & Selectors<TSignalValue>;

type EffectsState<
	TSignalValue extends NoOptionalProperties<TSignalValue>,
	TActionSources extends NamedActionSources<TSignalValue>,
	TSelectors extends NamedSelectors
> = SelectorsState<TSignalValue> &
	ExtraSelectors<TSelectors> &
	ActionMethods<TSignalValue, TActionSources>;

Copy link

nx-cloud bot commented Jan 5, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c6cfed2. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


⌛ The following target is in progress

✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@nartc nartc merged commit 2d3a216 into ngxtension:main Jan 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] signalSlice: unable to call actionSources if selectors are defined
2 participants