cosmos-explorer/src/applyExplorerBindings.ts
Steve Faulkner b0b973b21a
Refactor explorer config into useKnockoutExplorer hook (#397)
Co-authored-by: Steve Faulkner <stfaul@microsoft.com>
2021-01-25 13:56:15 -06:00

15 lines
671 B
TypeScript

import { BindingHandlersRegisterer } from "./Bindings/BindingHandlersRegisterer";
import * as ko from "knockout";
import Explorer from "./Explorer/Explorer";
export const applyExplorerBindings = (explorer: Explorer) => {
if (!!explorer) {
window.dataExplorer = explorer;
BindingHandlersRegisterer.registerBindingHandlers();
ko.applyBindings(explorer);
// This message should ideally be sent immediately after explorer has been initialized for optimal data explorer load times.
// TODO: Send another message to describe that the bindings have been applied, and handle message transfers accordingly in the portal
$("#divExplorer").show();
}
};