Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling for unavailable UI5 APIs #615

Open
marianfoo opened this issue Aug 19, 2024 · 0 comments
Open

Improve handling for unavailable UI5 APIs #615

marianfoo opened this issue Aug 19, 2024 · 0 comments
Assignees

Comments

@marianfoo
Copy link
Member

Some UI5 APIs are deprecated and removed and replaced by other UI5 APIs. There is logic to check if library is availabe.

The sap.ui.require(["..."], function) does not check if the library is already loaded.
Change it to execute sap.ui.require("...") first to check if library already loaded, if not, execute sap.ui.require(["..."], function).

static async loadUI5RessourceAsync(libraryName: string): Promise<any> {
return new Promise(function (resolve, reject) {
sap.ui.require(
[libraryName],
function (Library: unknown) {
resolve(Library);
},
function (err: any) {
reject(err);
}
);
});
}

@marianfoo marianfoo added the enhancement New feature or request label Aug 19, 2024
@marianfoo marianfoo self-assigned this Oct 2, 2024
@marianfoo marianfoo removed the enhancement New feature or request label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant