mutoe/vue3-realworld-example-app

Use Harlem instead vuex

levchak0910 opened this issue ยท 7 comments

I would like to suggest to use plain composable functions instead vuex for a reason: awful typescript support at the moment
What I don't really like that we don't have any type hints in IDE
Current normal type checking is very wordy. Look closer to this repositories 1, 2

Based on @kiaking's topik I would like to use plain composables and after vuex v5 will be released, rewrite our store

@mutoe what do you think?

mutoe commented

I agree with you. Actually this small system isn't necessarily using Vuex (and Redux in React). I only added it because I wanted to use the Vuex in the Vue3 and see how it worked.

Turns out to be a little tricky, and does not support TypeScript well (including the current type declaration for props).

I agree to use the modes Provider and Customer for state management, which is kind of like the Context in which React hooks are. It's important to note that this would be radical, but I support the point worth making. Go for it!

mutoe commented

Most of our system features has been completed, and I will work on the test next(cypress e2e test).

For e2e tests exist this repo
Maybe it will be easier to copypaste some tests)

mutoe commented

For e2e tests exist this repo
Maybe it will be easier to copypaste some tests)

Emm... Shocking! So Let me just copy it ๐Ÿ˜†

I found awesome state manager Harlem for vue 3 and decided to use it instead plain Composition API

Better option nowadays to use Pinia

mutoe commented

Better option nowadays to use Pinia

Thanks for the reminder, will consider it in future :)