• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ngxs-labs / firestore-plugin / 9764102805

02 Jul 2024 03:47PM UTC coverage: 56.566% (-0.9%) from 57.44%
9764102805

push

github

joaqcid
chore(deps): ngxs v18

71 of 184 branches covered (38.59%)

Branch coverage included in aggregate %.

657 of 1103 relevant lines covered (59.56%)

26.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.81
/integrations/modular/src/app/components/list/list.component.ts
1
import { Component, OnInit, OnDestroy } from '@angular/core';
1✔
2
import { Store } from '@ngxs/store';
1✔
3
import { RacesActions } from './../../states/races/races.actions';
1✔
4
import { RacesState } from './../../states/races/races.state';
1✔
5
import { ClassificationsState } from './../../states/classifications/classifications.state';
1✔
6
import { ClassificationsActions } from './../../states/classifications/classifications.actions';
1✔
7
import { Race } from './../../models/race';
8
import { Chance } from 'chance';
1✔
9
import { map } from 'rxjs/operators';
1✔
10
import { actionsExecuting } from '@ngxs-labs/actions-executing';
1✔
11
import { Disconnect } from '@ngxs-labs/firestore-plugin';
1✔
12

13
@Component({
14
  selector: 'app-list',
15
  templateUrl: './list.component.html',
16
  styleUrls: ['./list.component.scss']
17
})
18
export class ListComponent implements OnInit, OnDestroy {
1✔
19
  races$ = this.store.select(RacesState.races);
1✔
20
  classifications$ = this.store.select(ClassificationsState.classifications);
1✔
21
  total$ = this.races$.pipe(map((races) => races.length));
1✔
22

23
  gettingAll$ = this.store.select(actionsExecuting([RacesActions.GetAll]));
1✔
24
  gettingSingle$ = this.store.select(actionsExecuting([RacesActions.Get]));
1✔
25
  creating$ = this.store.select(actionsExecuting([RacesActions.Create]));
1✔
26
  loading$ = this.store.select(actionsExecuting([RacesActions.GetAll, RacesActions.Get]));
1✔
27
  loaded$ = this.loading$.pipe(map((loading) => !loading));
1✔
28
  disconnecting$ = this.store.select(actionsExecuting([Disconnect]));
1✔
29
  throwingError$ = this.store.select(actionsExecuting([RacesActions.Error]));
1✔
30
  gettingSubCollection$ = this.store.select(actionsExecuting([ClassificationsActions.GetAll]));
1✔
31

32
  constructor(private store: Store) {}
1✔
33

34
  ngOnInit() {
35
    // this.store.dispatch(new RacesActions.GetAll());
36
    // this.store.dispatch(new RacesActions.Get('8iI)0md[dTAFC[wo!&[N'));
37
    // this.store.dispatch(new RacesActions.Get('AAAAAA'));
38
  }
39

40
  disconnect() {
41
    this.store.dispatch(new Disconnect(new RacesActions.Get(']cfct5iL8(H)@Sl#xTcS')));
×
42
  }
43

44
  reconnect() {
45
    // this.store.dispatch(new RacesActions.GetAll());
46
    // this.store.dispatch(new RacesActions.Get('8iI)0md[dTAFC[wo!&[N'));
47

48
    this.store.dispatch(new RacesActions.Get(']cfct5iL8(H)@Sl#xTcS'));
×
49
  }
50

51
  getAll() {
52
    this.store.dispatch(new RacesActions.GetAll());
×
53
  }
54

55
  getSubCollection() {
56
    this.store.dispatch(new ClassificationsActions.GetAll('0NN6x6GKDGumGU5dtnk4'));
×
57
  }
58

59
  getCollectionGroup() {
60
    this.store.dispatch(new RacesActions.CollectionGroup());
×
61
  }
62

63
  get() {
64
    // const ids = ['4(CPo6Fy(7Mo^YklK[Q8', 'FouQf@q4FHJcc&%cnmkT', 'LBWH5KvYp43ia)!IYpwv', ']cfct5iL8(H)@Sl#xTcS'];
65
    // for (let index = 0; index < ids.length; index++) {
66
    //   setTimeout(() => this.store.dispatch(new RacesActions.Get(ids[index])), 1000 * index);
67
    // }
68

69
    this.store.dispatch(new RacesActions.Get('0V!^fMrWetbs68]ob6%M'));
×
70
  }
71

72
  create() {
73
    const chance = new Chance();
×
74
    const race: Partial<Race> = {};
×
75
    // race.id = chance.string({ length: 20 });
76
    race.raceId = chance.string({ length: 20 });
×
77
    race.name = chance.word();
×
78
    race.title = chance.word();
×
79
    race.description = chance.sentence();
×
80
    this.store.dispatch(new RacesActions.Create(race));
×
81

82
    // this.store.dispatch(new RacesActions.Create({
83
    //   id: 'test-id',
84
    //   name: 'Test',
85
    //   title: 'Test Title',
86
    //   description: 'Test description',
87
    // }));
88
  }
89

90
  update(race: Race) {
91
    const chance = new Chance();
×
92

93
    this.store.dispatch(
×
94
      new RacesActions.Update({
95
        ...race,
96
        name: chance.string(),
97
        description: chance.word()
98
      })
99
    );
100
  }
101

102
  updateIfExists(race: Race) {
103
    const chance = new Chance();
×
104

105
    this.store.dispatch(
×
106
      new RacesActions.UpdateIfExists({
107
        ...race,
108
        name: chance.string(),
109
        description: chance.word()
110
      })
111
    );
112
  }
113

114
  delete(id: string) {
115
    this.store.dispatch(new RacesActions.Delete(id));
×
116
  }
117

118
  ngOnDestroy() {
119
    this.store.dispatch(new Disconnect(RacesActions.GetAll));
1✔
120
  }
121

122
  throwError() {
123
    this.store.dispatch(new RacesActions.Error());
×
124
  }
125
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc