Skip to content

Commit

Permalink
feat: Add "afterConnect" hook to allow using injected store in object…
Browse files Browse the repository at this point in the history
… initialization
  • Loading branch information
AndreasMaros committed Jul 24, 2024
1 parent 01b0fcd commit 03c4246
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ export class EnhancedElement<
public connect<Sx extends StoreType<any>>(store: Sx): this {
this.store = store as unknown as S;
this.unsubscribe = store.subscribe(this.onStateUpdate.bind(this));
this.onAfterConnect();

return this;
}

protected onAfterConnect() {}

public getElement(): ET {
return this.element;
}
Expand Down

0 comments on commit 03c4246

Please sign in to comment.