-
Notifications
You must be signed in to change notification settings - Fork 91
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
Incorrect recognized types for SignalSlice in Rider IDE #519
Comments
After some further investigation I've noticed that the top lever property-selectors problem only occurs when there is more than one source in the |
Hi @robbaman can you provide the sources/config that produces the issue (or a simplified repro) and I'll look into it, thanks |
Hi Josh, thanks for getting back to me. The issue is pretty easy to reproduce. First I create a new blank project: ng new ExampleProject --skip-git
cd ExampleProject
ng add ngxtension Then in the app.component.ts I add a state interface at the top: interface State {
pageName: string;
somethingElse: number;
oneMoreThing: number;
} And some code to initialize the signalSlice readonly initialState: State = {
oneMoreThing: 54,
somethingElse: 54,
pageName: '',
} as const
state = signalSlice({
initialState: this.initialState,
sources: [
(state) => of({pageName: 'PageName', oneMoreThing: 10}),
//() => of(this.initialState)
]
})
constructor() {
var value = this.state.pageName();
var y = this.state.somethingElse();
} In addition I just replace the app.component.html content with this: <div>
{{state.oneMoreThing()}}
</div>
<div>
{{state.pageName()}}
</div>
<div>
{{state.somethingElse()}}
</div> Now, this will compile just fine, and Rider will provide intellisense and font coloring as expected. However, when you uncomment the second source And by showing an error in the template file: Note that this is in the Rider IDE only, the project still builds and runs fine Some noteworthy observations:
I hope this helps. |
We're looking to use SignalSlice in our projects, but we notice that the editor support in Rider is not too great. Unfortunately I'm not TypeScript expert enough to figure out what is going wrong.
What happens is that all the auto-generated top level property-selectors are not recognized (
timelineQueryParams
is a top level property on the state, whereasfilterCount
is a custom selector defined in theselectors
section of the config).In addition, the actions on the state object are recognized to exist, but also seem to have their types recognized incorrectly so it gives an error in Rider.
Is this anything that can be fixed? As mentioned, I'm not that great at TypeScript and just looking at the type-magic going on in the SignalSlice source makes my head spin
The text was updated successfully, but these errors were encountered: