pass a callback to handle Drag and Drop state changes#46
Conversation
Codecov ReportBase: 54.89% // Head: 55.08% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## feature/drag-and-drop #46 +/- ##
=========================================================
+ Coverage 54.89% 55.08% +0.19%
=========================================================
Files 64 64
Lines 3323 3342 +19
Branches 977 985 +8
=========================================================
+ Hits 1824 1841 +17
- Misses 1174 1176 +2
Partials 325 325
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| ); | ||
| } | ||
|
|
||
| exportContent(): View { |
There was a problem hiding this comment.
Why move this from the controller to here?
There was a problem hiding this comment.
Also can you mark this as either public or private
| this.realAssetMappings.delete(assetSymbol); | ||
| parentDropTarget.value = this.computeViewForDropTarget(parentDropTarget); | ||
|
|
||
| this.handleDndStateChange(this.exportContent()); |
There was a problem hiding this comment.
To make it a bit cleaner, Instead of calling the passed in function directly here with arguments, there should be a local function that does any of the necessary pre-processing and then called the passe in function.
| @@ -507,33 +527,38 @@ export class RuntimeFlowState { | |||
|
|
|||
| createDropTarget( | |||
There was a problem hiding this comment.
This should be private for now
| const baseView = this.view; | ||
|
|
||
| /** Walks the drag and drop state to remove any drop target assets */ | ||
| const removeDndStateFromView = (obj: unknown): any => { |
There was a problem hiding this comment.
This might be better to define in a utility file or something since it is static and doesn't really need to be in the flow state manager.
There was a problem hiding this comment.
extracted exportContent to a helper function
pass a callback to handle Drag and Drop state changes