Skip to content

Commit

Permalink
added line
Browse files Browse the repository at this point in the history
  • Loading branch information
LevanovaElena committed Sep 18, 2023
1 parent 064fed0 commit c96a7c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utils/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class Block {
};

public id = uuidv4();
protected props: Object;
protected props: any;
protected _element: HTMLElement | null = null;
protected _meta: { props: Object; }|null=null;
protected _meta: { props: any; }|null=null;
private _eventBus: () => EventBus;
private children: Record<string, Block>;
protected refs: Record<string, Block> = {};

constructor( propsWithChildren:Object = {}) {
constructor( propsWithChildren:any = {}) {
const eventBus = new EventBus();
const {props, children} = this._getChildrenAndProps(propsWithChildren);

Expand All @@ -38,7 +38,7 @@ class Block {
eventBus.emit(Block.EVENTS.INIT);
}

_getChildrenAndProps(childrenAndProps: Object) {
_getChildrenAndProps(childrenAndProps: any) {
const props: Record<string, unknown> = {};
const children: Record<string, Block> = {};

Expand Down Expand Up @@ -78,20 +78,20 @@ class Block {
Object.values(this.children).forEach(child => child.dispatchComponentDidMount());
}

private _componentDidUpdate(oldProps:Object, newProps:Object) {
private _componentDidUpdate(oldProps:any, newProps:any) {
const response = this.componentDidUpdate(oldProps, newProps);
if(response) {

this._eventBus().emit(Block.EVENTS.FLOW_RENDER);
}
}

protected componentDidUpdate(oldProps:Object, newProps:Object) {
protected componentDidUpdate(oldProps:any, newProps:any) {
// this.setProps(newProps);
return isDeepEqual(oldProps, newProps);
}

setProps = (nextProps:Object) => {
setProps = (nextProps:any) => {
if (!nextProps) {
return;
}
Expand Down
Empty file.
Empty file.

0 comments on commit c96a7c8

Please sign in to comment.