Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

watchable computed states Β #221

Open
@leopf

Description

@leopf

πŸ†• Feature Request

Make computed states watchable.

❓ Is your feature request related to a problem?

It would be nice to react to changes on computed states.

πŸ“„ Describe the solution you'd like

Move the watch and removeWatcher methods from EnhancedState class to the State class. Additionally it would be nice to have a Watchable interface which is implemented on State. Since this proposed change won't make Collections watchable, by implementing the Watchable interface on the Collection class you could make it watchable with a few changes in the future.

The watchable interface would be used where only the watch and removeWatcher methods are used. For example the useWatcher react hook.

πŸ“ƒ Describe alternatives you've considered

Alternatively the Watchable interface is not required, would just be nice to have.

βž• Additional Notes

I have the changes implemented in a fork already. If this feature request is accepted, I would follow up with a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @agile-ts/coreRelated to the @agile-ts/core packageenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions