Giter Club home page Giter Club logo

Comments (5)

robokozo avatar robokozo commented on June 3, 2024 4

I'm having this problem too. I have a few getters that do some processing based on the url param/query values but it's triggering even when not being changed.

from vuex-router-sync.

urkle avatar urkle commented on June 3, 2024 4

This fork provides the functionality of only pushing updates when values change. https://github.com/lukas-tr/vuex-enhanced-router-sync

from vuex-router-sync.

gilles-crealp avatar gilles-crealp commented on June 3, 2024 4

@urkle Can't you make a PR to vuex-router-sync to fix this issue?

from vuex-router-sync.

subev avatar subev commented on June 3, 2024 1

Ye this is pretty annoying, the getter should be updated only if the values are different. The issue we have is when we have computed properties that somehow access the anything on the router they are all precomputed although the params are still the same. I believe this should be by default and have an option to behave such forceful way.

from vuex-router-sync.

queensGambyte avatar queensGambyte commented on June 3, 2024

Totally need this. Even if DOM is not updated because of this, there is quite a lot of unnecessary computation for Virtual DOM.

I've tested something like this mixin, and it works for views. Can something similar be implemented for store getters also, which depend on router store's state?




'use strict';
const _ = require('lodash');

//Expects 'qPsToCache'.
//Adds '$_qpsManager_cachedQPs', which is updated when 'qPsToCache' is truly updated.

module.exports = {
    data() {
        return {
            $_qpsManager_cachedQPs: {}
        }
    },

    watch: {
        qPsToCache(toQPs, fromQPs) {
            if(!_.isEqual(toQPs, fromQPs)) this.$data.$_qpsManager_cachedQPs = toQPs;
        }
    },

    created() {
        this.$data.$_qpsManager_cachedQPs = this.qPsToCache;
    }
};

from vuex-router-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.