import { initGlobalState } from 'qiankun';
import Vue from 'vue';
export default function createWebSocketPlugin (options) {
  return (store) => {
    console.log('subscribe--------------------------', store);

    const initState = Vue.observable(store.state);
    const actions = initGlobalState(initState);
    store.subscribe((mutation, state) => {
      // 每次 mutation 之后调用
      // mutation 的格式为 { type, payload }
      actions.setGlobalState(initState);
    });
  };
}
