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

ngxs-labs / firestore-plugin / 9764976207

02 Jul 2024 04:52PM UTC coverage: 19.452% (-37.1%) from 56.566%
9764976207

push

github

joaqcid
chore(release): 18.0.2

59 of 184 branches covered (32.07%)

Branch coverage included in aggregate %.

232 of 1312 relevant lines covered (17.68%)

20.16 hits per line

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

0.0
/integrations/compat/src/app/components/list/list.component.ts
1
import { Component, OnInit, OnDestroy } from '@angular/core';
×
2
import { Store } from '@ngxs/store';
×
3
import { RacesActions } from '../../states/races/races.actions';
×
4
import { RacesState } from '../../states/races/races.state';
×
5
import { ClassificationsState } from '../../states/classifications/classifications.state';
×
6
import { ClassificationsActions } from '../../states/classifications/classifications.actions';
×
7
import { Race } from '../../models/race';
8
import { Chance } from 'chance';
×
9
import { map } from 'rxjs/operators';
×
10
import { actionsExecuting } from '@ngxs-labs/actions-executing';
×
11
import { Disconnect } from '@ngxs-labs/firestore-plugin';
×
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 {
×
19
  races$ = this.store.select(RacesState.races);
×
20
  classifications$ = this.store.select(ClassificationsState.classifications);
×
21
  total$ = this.races$.pipe(map((races) => races.length));
×
22

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

32
  constructor(private store: Store) {}
×
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
  get() {
60
    // const ids = ['4(CPo6Fy(7Mo^YklK[Q8', 'FouQf@q4FHJcc&%cnmkT', 'LBWH5KvYp43ia)!IYpwv', ']cfct5iL8(H)@Sl#xTcS'];
61
    // for (let index = 0; index < ids.length; index++) {
62
    //   setTimeout(() => this.store.dispatch(new RacesActions.Get(ids[index])), 1000 * index);
63
    // }
64

65
    this.store.dispatch(new RacesActions.Get('0V!^fMrWetbs68]ob6%M'));
×
66
  }
67

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

78
    // this.store.dispatch(new RacesActions.Create({
79
    //   id: 'test-id',
80
    //   name: 'Test',
81
    //   title: 'Test Title',
82
    //   description: 'Test description',
83
    // }));
84
  }
85

86
  update(race: Race) {
87
    const chance = new Chance();
×
88

89
    this.store.dispatch(
×
90
      new RacesActions.Update({
91
        ...race,
92
        name: chance.string(),
93
        description: chance.word()
94
      })
95
    );
96
  }
97

98
  updateIfExists(race: Race) {
99
    const chance = new Chance();
×
100

101
    this.store.dispatch(
×
102
      new RacesActions.UpdateIfExists({
103
        ...race,
104
        name: chance.string(),
105
        description: chance.word()
106
      })
107
    );
108
  }
109

110
  delete(id: string) {
111
    this.store.dispatch(new RacesActions.Delete(id));
×
112
  }
113

114
  ngOnDestroy() {
115
    this.store.dispatch(new Disconnect(RacesActions.GetAll));
×
116
  }
117

118
  throwError() {
119
    this.store.dispatch(new RacesActions.Error());
×
120
  }
121
}
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