Skip to content

Fix/ts errors stores - #114

Open
maria-jon wants to merge 13 commits into
mainfrom
fix/ts-errors-stores
Open

Fix/ts errors stores#114
maria-jon wants to merge 13 commits into
mainfrom
fix/ts-errors-stores

Conversation

@maria-jon

Copy link
Copy Markdown
Collaborator
  • change StoreProvider type from Component to ParentComponent to remove ts error in app.tsx
  • add interface typing StoreParameters to createStore
  • add Store type to store const
  • fix typing issues with Store type

@maria-jon
maria-jon requested a review from russbiggs December 11, 2025 12:55

@russbiggs russbiggs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid any and provide reasoning for ParentComponent

Comment thread src/stores/index.tsx
@@ -1,4 +1,4 @@
import { createContext, useContext, Component } from 'solid-js';
import { createContext, useContext, ParentComponent } from 'solid-js';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some context why the ParentComponent type if the right option for this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.solidjs.com/configuration/typescript#components-with-children

Looking at the documentation, ParentComponent seems to be the correct choice since it's a component with children rather than props.

Comment thread src/stores/index.tsx Outdated
addRecentMeasurements: () => void;
updateRecentMeasurements: (parameter: string, measurements) => void;
setTotalProviders: () => void;
setRecentMeasurements: (measurements: any) => void;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give these more concrete types and avoid any

Comment thread src/stores/index.tsx
setTotalProviders: () => void;
setRecentMeasurements: (measurements: any) => void;
addRecentMeasurements: (measurements: any) => void;
updateRecentMeasurements: (parameter: string, measurements: any) => void;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give these more concrete types and avoid any

Comment thread src/stores/index.tsx Outdated
updateRecentMeasurements: (parameter: string, measurements) => void;
setTotalProviders: () => void;
setRecentMeasurements: (measurements: any) => void;
addRecentMeasurements: (measurements: any) => void;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give these more concrete types and avoid any

Comment thread src/stores/index.tsx Outdated
});
},
setProviders(providers) {
setProviders(providers: any) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give this a more concrete type and avoid any

Comment thread src/stores/index.tsx Outdated
setState({ totalProviders: totalProviders });
},
setRecentMeasurements(measurements) {
setRecentMeasurements(measurements: any) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give this a more concrete type and avoid any

Comment thread src/stores/index.tsx
]);
},
updateRecentMeasurements(parameter: string, measurements) {
updateRecentMeasurements(parameter: string, measurements: any) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give this a more concrete type and avoid any

Comment thread src/stores/index.tsx Outdated
setState({isFlipped: !state.isFlipped });
},
setGroupLocationsIds(groupLocationsIds) {
setGroupLocationsIds(groupLocationsIds: any) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give this a more concrete type and avoid any

Comment thread src/stores/index.tsx Outdated
setState({ groupLocationsIds: groupLocationsIds })
},
setGroups(groups) {
setGroups(groups: any[]) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give this a more concrete type and avoid any

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.

2 participants