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

synchronously recompute value after state change #220

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

leopf
Copy link

@leopf leopf commented Jan 24, 2022

These changes will allow synchronous updates to computed states. To accomplish this I made the following changes:

  • cache if the function is asynchronous
  • before computing the value, check if it needs to be computed asynchronously. If not do it synchronously.
  • added a test, to test these changes
  • fixed some tests, since some methods have changed in usage and naming

📄 Description

Bug fix, see #219

🔴 Related Issue

Related issue #219

📃 Context

Seems to be a bug/missing feature so far.

🛠 How Has This Been Tested?

Added a new test to "computed.test.ts" to verify that the changes work.

@bennobuilder bennobuilder self-assigned this Jan 24, 2022
@bennobuilder bennobuilder added @agile-ts/core Related to the @agile-ts/core package tag: bug fix Changelog Tag for 'bug fix' labels Jan 24, 2022
@bennobuilder
Copy link
Contributor

I appreciate your work very much. 🙏👍
Would you mind changing the target branch to the devlop branch?
The master branch is for releases only.

See CONTRIBUTING.md Branch-Organization

Thanks a lot ;D

@leopf leopf changed the base branch from master to develop January 24, 2022 18:30
@leopf
Copy link
Author

leopf commented Jan 24, 2022

Sorry about that!

Thanks for creating this project! It solves a lot of problems for me, without having to do it all myself.
You will probably hear from me again! 😉

@bennobuilder bennobuilder changed the base branch from develop to feature/compute-in-sync January 26, 2022 16:31
@bennobuilder bennobuilder merged commit 9acb5b4 into agile-ts:feature/compute-in-sync Jan 26, 2022
@bennobuilder bennobuilder mentioned this pull request Sep 4, 2022
@github-actions github-actions bot mentioned this pull request Sep 4, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
@agile-ts/core Related to the @agile-ts/core package tag: bug fix Changelog Tag for 'bug fix'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants