https://github.com/oshinbiggestlab/counter_app
Learning GenServer with Counter app
https://github.com/oshinbiggestlab/counter_app
css elixir frontend genserver html phoenix-liveview tailwind
Last synced: 2 months ago
JSON representation
Learning GenServer with Counter app
- Host: GitHub
- URL: https://github.com/oshinbiggestlab/counter_app
- Owner: OshinBiggestLab
- Created: 2025-05-12T23:20:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-20T23:30:10.000Z (about 1 year ago)
- Last Synced: 2025-05-21T00:29:50.319Z (about 1 year ago)
- Topics: css, elixir, frontend, genserver, html, phoenix-liveview, tailwind
- Language: JavaScript
- Homepage:
- Size: 31.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Counter App
```
defmodule Counter.Server do
use GenServer
def start_link(initial) do
GenServer.start_link(__MODULE__, initial, name: __MODULE__)
end
end
```
GenServer.start_link(
__MODULE__, # (1) Your GenServer module (e.g. Counter.Server)
initial, # (2) The starting state passed to init/1
name: **MODULE** # (3) Register the server using your module name
)
First __MODULE__ says:
“I want to start a GenServer using my own module’s logic.”
Second __MODULE__ says:
“Register me with this name so I can be called globally.”