Skip to content

2.0.0-beta.14 updating a store only makes the touched part pending #2743

@GabbeV

Description

@GabbeV

Describe the bug

When a store is updated in an action only the modified properties of the store report pending during the update instead of the whole store.

Setting optimisitc state is often used paired with a refresh that causes the entire store to become pending leading to a weird result where only part of the store is pending until the mutation is done and then the entire store become pending.

This might not strictly be a bug however if it is intended behavior then there probably need to be a way to make the entire store pending early in cases where it is paired with a refresh.

Your Example Website or App

https://stackblitz.com/edit/solidjs-templates-z6mksiyl?file=src%2FApp.tsx

Steps to Reproduce the Bug or Issue

  1. Open repro
  2. Click button
  3. Observe that a becomes pending for one second before b also become pending.

Expected behavior

I expect the entire store to become pending when part of the update as all other ways of updating a store like a dependency changing or refresh both have that effect.

Screenshots or Videos

No response

Platform

  • OS: Windows 11
  • Browser: Firefox

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions