This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { GameStatus } from './hangman/model' | |
| import { Helper } from './hangman/helper' | |
| import { timer, Subject } from 'rxjs' | |
| import express from 'express' | |
| import { reactiveHangman } from './hangman/reactive-hangman' | |
| import { StateManager } from './hangman/state-manager' | |
| import { take, distinctUntilKeyChanged } from 'rxjs/operators' | |
| const app = express() | |
| const port = 3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface IGameState { | |
| id: string | |
| status: GameStatus | |
| selectedLetters: string[] | |
| lifeLeft: number | |
| secretWordLength: number | |
| knownSecretWord: string | |
| timeLeft: number | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Helper } from './helper' | |
| import { Observable, combineLatest, Subject } from 'rxjs' | |
| import { | |
| refCount, | |
| scan, | |
| startWith, | |
| switchMapTo, | |
| takeUntil, | |
| publishBehavior, | |
| } from 'rxjs/operators' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { v4 } from 'uuid' | |
| import { random } from 'lodash' | |
| import { merge } from 'ramda' | |
| import { GameStatus, IGameState } from './model' | |
| export class Helper { | |
| static secretWords = [ | |
| 'adventurous', | |
| 'courageous', | |
| 'extramundane', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { IGameState } from './model' | |
| import { Subject, Observable } from 'rxjs' | |
| export class StateManager { | |
| static state$Dict: { [key: string]: Observable<IGameState> } = {} | |
| static letter$Dict: { [key: string]: Subject<string> } = {} | |
| static setState$ = (key: string, state: Observable<IGameState>) => { | |
| StateManager.state$Dict[key] = state | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { v4 } from 'uuid' | |
| import { random } from 'lodash' | |
| import { merge } from 'ramda' | |
| import { GameStatus, IGameState } from './model' | |
| export class Helper { | |
| static secretWords = [ | |
| 'adventurous', | |
| 'courageous', | |
| 'extramundane', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| trim, | |
| match, | |
| replace, | |
| split, | |
| test, | |
| toLower, | |
| toString, | |
| toUpper, | |
| partial, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { FinalGoalState, finalGoalStateName } from './store/final-goal/final-goal.state'; | |
| import { Component, OnInit, OnDestroy, ViewChild, ElementRef } from '@angular/core'; | |
| import { Select, Store } from '@ngxs/store'; | |
| import { Observable, Subscription } from 'rxjs'; | |
| import { Navigate } from '@ngxs/router-plugin'; | |
| import { LocalStorageUtil } from './utils/local-storage.util'; | |
| import { UserState, userStateName } from './store/user/user.state'; | |
| import { IUserState } from './store/user/user.models'; | |
| import { length } from 'ramda'; | |
| import { IFinalGoalState, IFinalGoal } from './store/final-goal/final-goal.models'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="page"> | |
| <gridster [options]="options" #dragContainer> | |
| <gridster-item [item]="dashboard[0]"> | |
| <div class="container-500-500"> | |
| <div class="content"></div> | |
| </div> | |
| </gridster-item> | |
| <gridster-item [item]="dashboard[1]"> | |
| <div class="container-500-500"> | |
| <div class="content"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { FinalGoalState, finalGoalStateName } from './store/final-goal/final-goal.state'; | |
| import { Component, OnInit, OnDestroy, ViewChild, ElementRef } from '@angular/core'; | |
| import { Select, Store } from '@ngxs/store'; | |
| import { fromEvent, Observable, Subscription } from 'rxjs'; | |
| import { Navigate } from '@ngxs/router-plugin'; | |
| import { LocalStorageUtil } from './utils/local-storage.util'; | |
| import { UserState, userStateName } from './store/user/user.state'; | |
| import { IUserState } from './store/user/user.models'; | |
| import { length } from 'ramda'; | |
| import { IFinalGoalState, IFinalGoal } from './store/final-goal/final-goal.models'; |