Websockets, Typescript & A Trivia Game!?!?
Joe Benjamin
see working example at http://trivia-client-jdb.herokuapp.com/
This video is a discussion about a multi-player game I built using websockets. All code is written in typescript!!!
Code avail on github - https://github.com/joedbenjamin/questionsgame
Use this API to get the questions but if site is down, I use a local file to get them - https://opentdb.com/
Started with Styled Components but moving it to Material UI - https://material-ui.com/
Used this package to copy to clipboard - https://www.npmjs.com/package/clipboard-copy
React with the form using React Hooks and the other state is managed by MobX. https://reactjs.org/docs/hooks-intro.html https://mobx.js.org/README.html
Used local storage to store 2 ids to help me identify the ids of a closed websocket connection https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
This is still a work in progress - things will changed!!! ... https://www.youtube.com/watch?v=6G1_xAHYNOI
219759802 Bytes