mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
14 lines
399 B
TypeScript
14 lines
399 B
TypeScript
/**
|
|
* A simple wrapper around the startViewTransition API, if it exists. Otherwise
|
|
* it will just call the callback immediately.
|
|
*
|
|
* @param callback The callback to call inside the view transition.
|
|
*/
|
|
export const startViewTransition = (callback: UpdateCallback) => {
|
|
if (self.document.startViewTransition) {
|
|
self.document.startViewTransition(callback);
|
|
} else {
|
|
callback();
|
|
}
|
|
};
|