Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carstenkoenig/minesweeper-ps
Minesweeper clone in Purescript using Halogen-Hooks
https://github.com/carstenkoenig/minesweeper-ps
demo-app halogen halogen-hooks purescript
Last synced: about 1 month ago
JSON representation
Minesweeper clone in Purescript using Halogen-Hooks
- Host: GitHub
- URL: https://github.com/carstenkoenig/minesweeper-ps
- Owner: CarstenKoenig
- Created: 2020-08-04T15:09:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T03:42:33.000Z (about 2 years ago)
- Last Synced: 2024-10-15T09:17:49.816Z (3 months ago)
- Topics: demo-app, halogen, halogen-hooks, purescript
- Language: PureScript
- Homepage:
- Size: 194 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# minesweeper-ps
the well known classic game implemented in [*PureScript*](https://www.purescript.org/)
using [Halogen-Hooks](https://github.com/thomashoneyman/purescript-halogen-hooks).---
The goal of this project was for me to learn more about **halogen-hooks**
and how to use them.Along the way I used a few thing I had not much experience with:
- SCSS, CSS-Grid
- using a [EventSource](https://pursuit.purescript.org/packages/purescript-halogen/5.0.0/docs/Halogen.Query.EventSource#t:EventSource)
with **halogen** (in this case a very simple wrapper for a `setInterval`/timer)
- `preventDefault` on context-menuesI'm not sure if this is all really *idiomatic* so please let me know if any
of this here can be simplified or should be done differently.Overall the expereince with **hooks** was very pleasant and after I found
the hint to [`effectEventSource`](https://pursuit.purescript.org/packages/purescript-halogen/5.0.0/docs/Halogen.Query.EventSource#t:EventSource)
the *timer*-component was quite straightforward too.---
You might also find these **Halogen** conecpts used here interesting:
- parent-component querying it's child (see how the [Game-component enables the Timer-component](./src/Components/Game.purs))
- many children/slots of the same type (see how the [Cell-compoenents gets nested in the Game-component](./src/Components/Game.purs))
- children passing *Output* to their parants (see how the [Cell-compoenents notifies the Game-component on click-events](./src/Components/Game.purs))
- using `Effect`s (basically just add constaints for `MonadEffect` and `liftEffect`)