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

Allow updating node openness programmatically + global refactoring and dependecy updates #23

Merged
merged 6 commits into from
Aug 2, 2020

Conversation

Lodin
Copy link
Owner

@Lodin Lodin commented Aug 2, 2020

Resolves #21.

This PR contains the following changes.

opennessState

This PR introduces an ability to change the node openness state programmatically as requested in #21. To do it, you have to call recomputeTree method with a new parameter opennessState. You have to specify an object that contains IDs of nodes you want to toggle as keys and their new openness state as values.

treeRef.current.recomputeTree({
  opennessState: {
    foo: true,
    bar: false,
  }
});

NOTE: If you specify both useDefaultOpenness and opennessState, opennessState will be overridden by useDefaultOpenness results.

Breaking Changes

Along with the new feature, this PR specifies the breaking changes in Typescript types because of the global refactoring that reduces the size of the package significantly.

@Lodin Lodin self-assigned this Aug 2, 2020
@codecov
Copy link

codecov bot commented Aug 2, 2020

Codecov Report

Merging #23 into master will decrease coverage by 1.94%.
The diff coverage is 97.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
- Coverage   99.29%   97.34%   -1.95%     
==========================================
  Files           3        4       +1     
  Lines         141      113      -28     
  Branches       34       23      -11     
==========================================
- Hits          140      110      -30     
- Misses          1        3       +2     
Impacted Files Coverage Δ
src/Tree.tsx 96.07% <96.07%> (ø)
src/FixedSizeTree.tsx 100.00% <100.00%> (ø)
src/VariableSizeTree.tsx 96.96% <100.00%> (-1.80%) ⬇️
src/utils.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0da4fa8...35cb250. Read the comment docs.

@Lodin Lodin merged commit df700fa into master Aug 2, 2020
@Lodin Lodin deleted the feat/add-openness-update branch August 2, 2020 02:40
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.

Opening a node programatically
1 participant