Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Made ViewController to accept queries for external parameters (breaking change) #17

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

mnasyrov
Copy link
Owner

@mnasyrov mnasyrov commented Feb 1, 2023

No description provided.

@coveralls
Copy link

coveralls commented Feb 1, 2023

Pull Request Test Coverage Report for Build 4065216494

  • 12 of 12 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 4037653106: 0.0%
Covered Lines: 363
Relevant Lines: 363

💛 - Coveralls

@chartyom
Copy link
Contributor

chartyom commented Feb 1, 2023

Hi, Mikhail.
This PR is great!

When I was checking, I found one case allows a lot of executions

 PASS  packages/rx-effects-react/src/mvc.test.tsx (8.931 s)
  Console

    console.log
      object [ 1, 2 ]

      at packages/rx-effects-react/src/mvc.tsx:49:13

    console.log
      object [ 4, 10 ]

      at packages/rx-effects-react/src/mvc.tsx:49:13

    console.log
      object [ 4, 10 ]

      at packages/rx-effects-react/src/mvc.tsx:49:13

You can use the spread to memorize arguments

  useEffect(() => {
    params.forEach((value, index) => stores[index].set(value));
  }, [...params, stores]);

And in this case it will be like this

 PASS  packages/rx-effects-react/src/mvc.test.tsx (8.164 s)
  Console

    console.log
      object [ 1, 2 ]

      at packages/rx-effects-react/src/mvc.tsx:49:13

    console.log
      object [ 4, 10 ]

      at packages/rx-effects-react/src/mvc.tsx:49:13

@mnasyrov
Copy link
Owner Author

mnasyrov commented Feb 1, 2023

@chartyom Thank you. Please take a look on the last commit, I used a reference to keep stores out of rendering.

@chartyom
Copy link
Contributor

chartyom commented Feb 1, 2023

@mnasyrov perfect!

@mnasyrov mnasyrov merged commit ad49f8a into main Feb 1, 2023
@mnasyrov mnasyrov deleted the feat/use-view-controller-params branch February 1, 2023 15:14
mnasyrov added a commit that referenced this pull request Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants