9von10 / ngx-cytoscapejs

Angular 13+ Cytoscape.js Wrapper
MIT License
16 stars 5 forks source link

Evaluate necessity of lodash #2

Closed 9von10 closed 2 years ago

9von10 commented 2 years ago

Validate if lodash is really needed for proper change detection in OnChanges lifecycle hook.

See: https://angular.io/api/core/OnChanges

9von10 commented 2 years ago

lodash can be removed for immutable change detection. But need to validate how change detection works on mutable objects.

9von10 commented 2 years ago

Referencing the same mutable object does not trigger change detection but using an immutable object does. If you need to trigger change detection rerendering use the spread operator: this.cytoscapeOptions = { ...this.cytoscacytoscapeOptions };