-
Notifications
You must be signed in to change notification settings - Fork 121
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
Reducer: toggleSubtree #711
Comments
@raineorshine We cannot use |
@raineorshine We need to specifically parse |
Yes, those are all desirable changes.
Perhaps we should change the signature to accept JSON rather than a string. We can always convert the string to JSON beforehand. Then the imported root and its children will be easily accessible. I'm going to put this on hold until #714 is complete. There is some overlap. |
Sure. |
Define a new reducer
toggleSubtree
and write unit tests.Give the following subtree:
toggleSubtree(state, context, subtree)
should insert the subtree if{context}/a
does not exist.toggleSubtree(state, context, subtree)
should remove{context}/a
and all descendants if{context}/a
exists.toggleSubtree(state, context, subtree, { matchChild: true })
should insert the subtree if{context}/a
does not exist or if{context}/a/b
does not exist.toggleSubtree(state, context, subtree, { matchChild: true })
should remove{context}/a
and all descendants if{context}/a/b
exists.Use
importText
to convert the subtree to thought updates.The text was updated successfully, but these errors were encountered: