P
Я вот такие байндинги накидал для vue composition api
export function useStore<State>(store: Store<State>): ReadonlyRef<State> {
const stateRef = ref<any>();
const unwatch = store.watch(state => {
stateRef.value = state;
});
onUnmounted(unwatch);
return stateRef;
}
export function useStoreMap<State, Result>(
store: Store<State>,
fn: (state: State) => Result,
): ReadonlyRef<Result> {
const stateRef = useStore(store);
return computed(() => fn(stateRef.value));
}