Skip to content

Update the integration and add support signals#9

Open
ndt080 wants to merge 8 commits intonanostores:mainfrom
ndt080:main
Open

Update the integration and add support signals#9
ndt080 wants to merge 8 commits intonanostores:mainfrom
ndt080:main

Conversation

@ndt080
Copy link

@ndt080 ndt080 commented Aug 19, 2024

Hi. I updated the integration to use the api provided by preact. In addition, I made an alternative integration option with support for preact signals.

There are no updated tests yet, but there was no time to understand them out.

@ai
Copy link
Member

ai commented Aug 19, 2024

Wow, super interesting! What will be the difference?

@ndt080
Copy link
Author

ndt080 commented Aug 20, 2024

Thanks for the comments you left, I've made some changes to the PR.
Could you tell me which tests need to be implemented for the new implementation?

@ai
Copy link
Member

ai commented Aug 20, 2024

Could you tell me which tests need to be implemented for the new implementation?

Do you add any public API for end-user? If yes, we need to test them.

But I suggest that change useStore()

Thanks for the comments you left, I've made some changes to the PR.

I also need a little explanation why we need this change? Performance?

Will signals work for any modern Preact?

core/types.ts Outdated
@@ -0,0 +1,8 @@
import type { StoreValue } from 'nanostores';
Copy link
Member

Choose a reason for hiding this comment

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

We use types.ts in Nano Stores for type tests.

Can you move it to index.d.ts?

Copy link
Author

Choose a reason for hiding this comment

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

This file contains common type models for the "useStore" and "useStoreSignal" hooks

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it is better to put everything in single index.d.ts and index.js. This project is very small to use practices for huge projects.

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