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

Get node that was just removed? #133

Open
t3db0t opened this issue Dec 10, 2019 · 3 comments
Open

Get node that was just removed? #133

t3db0t opened this issue Dec 10, 2019 · 3 comments

Comments

@t3db0t
Copy link

t3db0t commented Dec 10, 2019

What's the best way to get a node that was just removed (by closing a window)? Right now I'm going to have to manually get a diff from the new layout provided by onChange...

@nomcopter
Copy link
Owner

nomcopter commented Dec 10, 2019

Pass custom toolbarControls to MosaicWindow. You can pass <RemoveButton /> the onClick prop to do what you want.

@t3db0t
Copy link
Author

t3db0t commented Dec 11, 2019

Sure—however, that would mean two independent callbacks that are hard to collate. I get the onChange with a new layout but with no explicit info about how the layout changed, and then I get the onClick with the info I need.

Thinking out loud, the ideal would be an operational model where onChange returns operations that are performed. Easy for me to say!! If I make that modification I'll send you a PR ;)

Outside of that—is there any other way to force some info into the onChange call?

@nomcopter nomcopter reopened this Dec 17, 2019
@nomcopter
Copy link
Owner

Not currently, but a second meta arg to onChange would make sense 👍

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

No branches or pull requests

2 participants