I have a singleton service shared for all components like this.
@Injectable({
providedIn: 'root'
})
export class ItemService {
items: Items [];
addItem(item: Item){
this.items.push(item);
}
getItems(){
return this.items;
}
}
it's thread-safe to use common fields. this case doesn't cause a problem in concurrency ?