fix(#2317): add condition for show switch
parent
ad4a33c812
commit
161629a114
@ -1,8 +0,0 @@ |
|||||||
import { createContext, useContext } from 'react' |
|
||||||
import { MatchesStore } from './matchesStore' |
|
||||||
|
|
||||||
export const RootStoreContext = createContext({ |
|
||||||
matchesStore: new MatchesStore(), |
|
||||||
}) |
|
||||||
|
|
||||||
export const useStores = () => useContext(RootStoreContext) |
|
||||||
@ -1,21 +0,0 @@ |
|||||||
import { makeAutoObservable, observable } from 'mobx' |
|
||||||
|
|
||||||
import type { Match } from 'features/Matches/hooks' |
|
||||||
|
|
||||||
export class MatchesStore { |
|
||||||
matches: Array<Match> = [] |
|
||||||
|
|
||||||
constructor() { |
|
||||||
makeAutoObservable(this, { |
|
||||||
matches: observable, |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
getMatches() { |
|
||||||
return this.matches |
|
||||||
} |
|
||||||
|
|
||||||
filterMatches(matches: Array<Match>, sport: number) { |
|
||||||
this.matches = matches.filter((match) => match.sportType === sport) |
|
||||||
} |
|
||||||
} |
|
||||||
Loading…
Reference in new issue