eBay / nice-modal-react
Showing 1 of 1 files from the diff.

@@ -79,6 +79,12 @@
Loading
79 79
   * Resolve the promise returned by {@link NiceModalHandler.hide | hide} method.
80 80
   */
81 81
  resolveHide: (args?: unknown) => void;
82 +
83 +
  /**
84 +
   * Resolves the promise returned by {@link NiceModalHandler.show | show} method with value `false`,
85 +
   * then removes the modal using the {@link NiceModalHandler.remove | remove} method.
86 +
   */
87 +
   resolveFalseAndRemove: () => void;
82 88
}
83 89
84 90
// Omit will not work if extends Record<string, unknown>, which is not needed here
@@ -339,6 +345,11 @@
Loading
339 345
    },
340 346
    [mid],
341 347
  );
348 +
  const resolveFalseAndRemove = useCallback(() => {
349 +
    const modalResolve = modalCallbacks[mid].resolve;
350 +
    modalResolve(false);
351 +
    remove(mid);
352 +
  }, [mid]);
342 353
343 354
  return {
344 355
    id: mid,
@@ -351,6 +362,7 @@
Loading
351 362
    resolve: resolveCallback,
352 363
    reject: rejectCallback,
353 364
    resolveHide,
365 +
    resolveFalseAndRemove,
354 366
  };
355 367
}
356 368
export const create = <P extends {}>(Comp: React.ComponentType<P>): React.FC<P & NiceModalHocProps> => {
Files Coverage
src/index.tsx 98.54%
Project Totals (1 files) 98.54%
Notifications are pending CI completion. Periodically Codecov will check the CI state, when complete notifications will be submitted. Push notifications now.
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading