Created
July 11, 2022 13:42
-
-
Save alaindet/814779006a7fd397d34ba515cd0b9bf9 to your computer and use it in GitHub Desktop.
Angular utilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SimpleChange } from '@angular/core'; | |
export function didInputChange(change?: SimpleChange): boolean { | |
if (!change) return false; | |
return change.firstChange || change.currentValue !== change.previousValue; | |
} | |
export function didInputsChange(changes: SimpleChange[]): boolean { | |
return changes.some(ch => didInputChange(ch)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment