frontend-plugin-api: return output from extension factories instead

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-27 13:51:02 +02:00
parent 6d041afa0c
commit 77f009b35d
28 changed files with 313 additions and 173 deletions
+3 -3
View File
@@ -107,14 +107,14 @@ export function createSearchResultListItemExtension<
output: {
item: searchResultItemExtensionData,
},
factory({ bind, config, source }) {
factory({ config, source }) {
const ExtensionComponent = lazy(() =>
options
.component({ config })
.then(component => ({ default: component })),
) as unknown as SearchResultItemExtensionComponent;
bind({
return {
item: {
predicate: options.predicate,
component: props => (
@@ -129,7 +129,7 @@ export function createSearchResultListItemExtension<
</ExtensionBoundary>
),
},
});
};
},
});
}