sita-samoa / sita-membership

VILT (Vue.js, Inertia.js, Laravel, Tailwind CSS) repo for SITA Membership Database
MIT License
5 stars 22 forks source link

Introduce a global state management in Vue #56

Closed westerandr closed 1 year ago

westerandr commented 1 year ago

Introduce a global state management in Vue

Technical Details

Every component of the sign up process uses a member_id variable that is passed as props. It would be good to have state management so that the member_id can be shared across many components and future ones to come. This satisfies the DRY principle.

Acceptance Criteria

Green-Ranger11 commented 1 year ago

Can we pull the model from built in authentication? Local storage, cookies whatever Jetstream uses under the hood?

ainsofs commented 1 year ago

If u do get around to this. Pinia is a good candidate. Also if u haven’t already u can install the vue dev extension to look at vue props being passed back from inertia. Auth stuff is there for current user. Can u customize to pass back member stuff if available

Green-Ranger11 commented 1 year ago

Will add Pinia and open a pr soon

ainsofs commented 1 year ago

Consider https://inertiajs.com/shared-data and

https://inertiajs.com/remembering-state

ainsofs commented 1 year ago

Pinia was added as part of new theme implementation

ainsofs commented 1 year ago

Pinia is there and you can pull member id from inertia. Closing this