Open VannaDii opened 5 years ago
Calling metrics.getMetricsDesc(); which is defined as:
metrics.getMetricsDesc();
import Vue from 'vue'; import Vuex, { Store } from 'vuex'; import { getStoreBuilder } from 'vuex-typex'; import { MetricsState } from './metricsState'; export interface RootState { metrics: MetricsState } Vue.use(Vuex); const store: Store<RootState> = getStoreBuilder<RootState>().vuexStore(); export { store }; export default store;
import { RootState } from './store'; import { getStoreBuilder } from 'vuex-typex'; const initialMetricsState: MetricsState = { allMetrics: [], isLoading: false } const builder = getStoreBuilder<RootState>().module('metrics', initialMetricsState); const metricsDesc = builder.read(state => state.allMetrics.sort((a, b) => (a.date > b.date ? -1 : 1)), 'metricsDesc'); const metrics = { // State get state() { return builder.state(); }, // Getter as method getMetricsDesc() { return metricsDesc(); }, }
@GioCirque I ran into the same error, did you ever find out why you got this error?
Calling
metrics.getMetricsDesc();
which is defined as: