Now we have control over our people rows and some filter controls in our view, we need to make our filters work. We are already filtering by our isActive key, so the radio buttons will be the first to be wired up. We already have the value in a Boolean form for both the radio buttons values and the key we will be filtering by. For this filter to work, we need to compare the isActive key with the radio button's value.
- If the filterUserState value is true, show users where isActive is true
- If the filterUserState value is false, however, only show users where their isActive value is false as well
This can be written in one line by comparing the two variables:
filterRow(person) { return (this.filterUserState === person.isActive); ...