_ruleUpdated(e) {
    if (e.cancelable || !this.hosts) {
      // Don't update rules if there's no local hosts array. Let the component
      // ask for all rules first.
      return;
    }
    const updatedValue = e.detail.rule;
    const index = this.hosts.findIndex((item) => item._id === updatedValue._id);
    if (index === -1) {
      this.hosts.push(updatedValue);
    } else {
      this.hosts[index] = updatedValue;
    }
  }
/**
   * Updates a rule from the `host-rules-changed` custom event.
   * The event should contain `rule` property on the event's detail object
   * containing the rule object.
   * @param {CustomEvent} e
   */
Updates a rule from the `host-rules-changed` custom event.
The event should contain `rule` property on the event's detail object
containing the rule object.
Updates a rule from the ` host - rules - changed ` custom event . The event should contain ` rule ` property on the event ' s detail object containing the rule object .
_ruleUpdated(e) {
    if (e.cancelable || !this.hosts) {
      return;
    }
    const updatedValue = e.detail.rule;
    const index = this.hosts.findIndex((item) => item._id === updatedValue._id);
    if (index === -1) {
      this.hosts.push(updatedValue);
    } else {
      this.hosts[index] = updatedValue;
    }
  }
_ruleUpdated ( e ) { if ( e . cancelable || ! this . hosts ) { return ; } const updatedValue = e . detail . rule ; const index = this . hosts . findIndex ( ( item ) => item . _id === updatedValue . _id ) ; if ( index === - 1 ) { this . hosts . push ( updatedValue ) ; } else { this . hosts [ index ] = updatedValue ; } }
Updates a rule from the `host-rules-changed` custom event.
Updates a rule from the ` host - rules - changed ` custom event .
// Don't update rules if there's no local hosts array. Let the component // ask for all rules first.