MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / transition

Function transition

core/src/utils/transition/index.ts:30–55  ·  view source on GitHub ↗
(opts: TransitionOptions)

Source from the content-addressed store, hash-verified

28 * @returns A promise that resolves when the transition is complete.
29 */
30export const transition = (opts: TransitionOptions): Promise<TransitionResult> => {
31 return new Promise((resolve, reject) => {
32 writeTask(() => {
33 const transitioningInactiveHeader = getIosIonHeader(opts);
34 beforeTransition(opts, transitioningInactiveHeader);
35 runTransition(opts)
36 .then(
37 (result) => {
38 if (result.animation) {
39 result.animation.destroy();
40 }
41 afterTransition(opts);
42 resolve(result);
43 },
44 (error) => {
45 afterTransition(opts);
46 reject(error);
47 }
48 )
49 .finally(() => {
50 // Ensure that the header is restored to its original state.
51 setHeaderTransitionClass(transitioningInactiveHeader, false);
52 });
53 });
54 });
55};
56
57const beforeTransition = (opts: TransitionOptions, transitioningInactiveHeader: HTMLElement | null) => {
58 const enteringEl = opts.enteringEl;

Callers 2

transitionMethod · 0.90
transitionMethod · 0.90

Calls 7

getIosIonHeaderFunction · 0.85
beforeTransitionFunction · 0.85
runTransitionFunction · 0.85
afterTransitionFunction · 0.85
resolveFunction · 0.85
setHeaderTransitionClassFunction · 0.85
destroyMethod · 0.65

Tested by

no test coverage detected