mutoe / vue3-realworld-example-app

Explore the charm of Vue composition API! Vite?

Home Page:https://vue3-realworld-example-app-mutoe.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Harlem instead vuex

levchak0910 opened this issue · 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?

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!

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)

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

Better option nowadays to use Pinia

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