Why is that when in a signal store (in a service), when I do
Service
protected static readonly removedAllowances: WritableSignal<(ContractAllowanceDTO)[]> = signal<(ContractAllowanceDTO})[]>([]);
/* getters */
public getRemovedllowances() {
return computed(() => ContractService.removedAllowances())
}
Component
In the component class
protected readonly removedAllowances = this.contractService.getRemovedAllowances();
let removedAllowances: any[];
removedAllowances = this.removedAllowances();
removedAllowances.pop();
console.log('allowance', this.contractService.getRemovedAllowances()())
It’s console logging the result as if the variable in the service, ContractService.removedAllowances(), has also been popped. I thought signals were read only? Why should removedAllowances.pop() at all affect ContractService.removedAllowances()?