vue-wamp icon indicating copy to clipboard operation
vue-wamp copied to clipboard

Vuex support

Open Yamakaky opened this issue 7 years ago • 2 comments

Cool lib! Do you support vuex?

Yamakaky avatar Mar 25 '17 15:03 Yamakaky

Hello, thanks! I'm using vuex, but only to make the isConnected, isOpen and isRetrying properties global and reactive.

What feature do you have in mind?

lajosbencz avatar Mar 27 '17 12:03 lajosbencz

Well, my whole state is synced! Currently I do that for getting the state:

    function playlist_next_ids(playlist_ids) {
        store.commit(Mut.set_playlist_next_ids.name, playlist_ids)
    }
    session.subscribe(Sub.playlist_next_ids.name, playlist_next_ids)

and that in the actions:

        delete_media({ commit }, media) {
            commit(Mut.delete_media_id.name, media.id)
            publish(Sub.delete_media_ids, [media.id])
        },

publish being a session.public using the wamp session as global variable. It's not a lot of code and it's only in one place so maybe it's not necessary to use vue-wamp.

Yamakaky avatar Mar 27 '17 12:03 Yamakaky