@lynx-js/web-core
Version:
This is an internal experimental package, do not use
23 lines • 896 B
JavaScript
// Copyright 2023 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { getPathInfoEndpoint } from '../../../endpoints.js';
import { ErrorCode } from '../../../../constants.js';
export function createGetPathInfo(rpc) {
return (type, identifier, component_id, first_only, callback, root_unique_id) => {
rpc.invoke(getPathInfoEndpoint, [
type,
identifier,
component_id,
first_only,
root_unique_id,
]).then(callback).catch((error) => {
console.error(`[lynx-web] getPathInfo failed`, error);
callback({
code: ErrorCode.UNKNOWN,
data: error.message || '',
});
});
};
}
//# sourceMappingURL=createGetPathInfo.js.map