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

Update the integration and add support signals #9

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

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?

.gitignore Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/signals/index.js Outdated Show resolved Hide resolved
@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?

.gitignore Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
core/defineStore.js Outdated Show resolved Hide resolved
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.

signals/index.js Outdated Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
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