Add end method to d3 transition (#39355)

This commit is contained in:
Max Mumford
2019-10-29 11:26:29 -07:00
committed by Jesse Trinity
parent b14675b1e6
commit 9da84cc5d7
2 changed files with 8 additions and 0 deletions
@@ -421,6 +421,9 @@ if (listener) {
// remove listener
enterTransition = enterTransition.on('end', null); // check chaining return type by re-assigning
// check end method exists
enterTransition.end();
// --------------------------------------------------------------------------
// Test Control Flow
// --------------------------------------------------------------------------
+5
View File
@@ -456,6 +456,11 @@ export interface Transition<GElement extends BaseType, Datum, PElement extends B
*/
on(type: string, listener: ValueFn<GElement, Datum, void>): this;
/**
* Returns a promise that resolves when every selected element finishes transitioning. If any elements transition is cancelled or interrupted, the promise rejects.
*/
end(): Promise<void>;
// Control Flow ----------------------
/**