import { computed, Injectable, Signal, signal } from '@angular/core';

@Injectable()
export class ExcludedPagesService {
    readonly shown: Signal<boolean>;
    readonly hidden: Signal<boolean>;
    readonly #show = signal(false);

    constructor() {
        this.shown = this.#show.asReadonly();
        this.hidden = computed(() => !this.#show());
    }

    show() {
        this.#show.set(true);
    }

    hide() {
        this.#show.set(false);
    }

    toggle() {
        this.#show.set(!this.#show());
    }
}
