Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simplify enabled option usage #46

@alexdln

Description

@alexdln

Currently, the enabled option supports a boolean or a function. This setting allows for considerable flexibility in choosing when the method should run. However, one of the most common uses is after hydration (critical for full-stack frameworks). For this purpose, users must create their own useState to track mounted and pass it to the contection hooks.

This issue will add new option for enabled setting: 'after-hydration'

The default behavior is also affected here. Now the initial values ​​of prevStore and prevMutatedStore will be calculated based on initialData. This will also allow for greater flexibility in full-stack frameworks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions