Coder Social home page Coder Social logo

Comments (6)

PaulMaly avatar PaulMaly commented on June 23, 2024

Returned to this proposal. I wonder, how we should figure out which value is not acceptable to the query param and which is not? For example, we've got a query state like this:

$query = {
   search: '',
   checked: false,
   selected: []
};

Should we remove the search param from this state? Is checked have a proper value at this moment? Seems both are falsy.

One more disadvantage is if we remove param from $query store we'll have to check all places to undefined. If we won't remove param from the store and just skip it in URL it will become some kind of inconsistency between state and URL. This inconsistency may cause us not to be able to recover falsy state for the specific value after page reload.

Any thoughts?

from svelte-pathfinder.

zyxd avatar zyxd commented on June 23, 2024

Maybe it makes sense not to remove any parameters from the state object, but hide it from string before history.pushState?

from svelte-pathfinder.

PaulMaly avatar PaulMaly commented on June 23, 2024

@zyxd The main issue is how to retrieve this state after page reload. So, this is exactly what I mean, our state is out of sync.

from svelte-pathfinder.

zyxd avatar zyxd commented on June 23, 2024

@PaulMaly I think it should be optional and disabled by default.

from svelte-pathfinder.

PaulMaly avatar PaulMaly commented on June 23, 2024

@zyxd Seems, this will cause us to lose information about the parameter type and be forced to check the value for existence in all places we use it:

{#if $query.filters} <!-- this check become necesery -->
   {#each $query.filters as filter}
       ...
   {/each}
{/if}

from svelte-pathfinder.

PaulMaly avatar PaulMaly commented on June 23, 2024

No updates here. Closed for now. Feel fee to open again if needed.

from svelte-pathfinder.

Related Issues (13)

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.