Viczei / ng2-swipe-cards

A kit of cards (including tinder-card) for angular2
MIT License
25 stars 18 forks source link

Add ChangeDetectionStrategy.OnPush for performance boost #44

Open chrillewoodz opened 7 years ago

Viczei commented 7 years ago

I'm not a huge fan of data immutability because it breaks JavaScript references. So i guess that with this change, for example: if i want to change the overlay like's color , i would have to write this.overlay = { like: { backgroundColor: '#28e93b' }, dislike: { backgroundColor: '#e92828' } }; or use a copy function from a framework in order to recreate the JavaScript object instead of just: this.overlay.like.backgroundColor = '#28e93b'; Well of course, i'm not really accustomed with immutable data, so i may be wrong. if it doesn't break anything in the way the component inputs work, i think it could be interesting to add it.