Run initial modelview actions first (#13317)

* Run initial modelview actions first

* add param

* Comments and typings

* Catch promise error

* fix db projects test

* remove extra calls
This commit is contained in:
Charles Gagnon
2020-11-10 17:00:16 -08:00
committed by GitHub
parent b4dd0442c5
commit b83da2dfa8
6 changed files with 70 additions and 42 deletions

View File

@@ -69,7 +69,7 @@ export interface IModelStore {
* @param componentId unique identifier of the component
* @param action some action to perform
*/
eventuallyRunOnComponent<T>(componentId: string, action: (component: IComponent) => T): Promise<T>;
eventuallyRunOnComponent<T>(componentId: string, action: (component: IComponent) => T, initial: boolean): void;
/**
* Register a callback that will validate components when given a component ID
*/

View File

@@ -35,12 +35,12 @@ export interface IModelView extends IView {
clearContainer(componentId: string): void;
addToContainer(containerId: string, item: IItemConfig, index?: number): void;
removeFromContainer(containerId: string, item: IItemConfig): void;
setLayout(componentId: string, layout: any): void;
setLayout(componentId: string, layout: any, initial?: boolean): void;
setItemLayout(componentId: string, item: IItemConfig): void;
setProperties(componentId: string, properties: { [key: string]: any }): void;
setProperties(componentId: string, properties: { [key: string]: any }, initial?: boolean): void;
setDataProvider(handle: number, componentId: string, context: any): void;
refreshDataProvider(componentId: string, item: any): void;
registerEvent(componentId: string): void;
registerEvent(componentId: string, initial?: boolean): void;
onEvent: Event<IModelViewEventArgs>;
validate(componentId: string): Thenable<boolean>;
readonly onDestroy: Event<void>;