SP slotplate
Concept

Presenters

State → view. Nothing more.

A presenter is a thin class that:

  1. Observes state (MobX autorun or reactions).
  2. Translates state into view calls (reelSet.setResult(...), DOM updates).
  3. Exposes a narrow API the FSM can drive (startSpin(), showWin()).

It does not decide when. A presenter with a setTimeout inside it is a presenter doing too much.

The two slotplate ships

  • ReelsPresenter — wraps the reel engine (pixi-reels). Only file outside view/ allowed to import it. Defines the ReelsEngine interface — swap implementations here.
  • HUDPresenter — binds MobX state to the plain DOM buttons in index.html. Swap for a React component if you want, as long as it keeps the same surface (mount(root), dispose()).

When to add a presenter

Add a new presenter when you have a new view surface to bridge:

  • WinlinePresenter for an overlay that draws payline paths.
  • BigWinPresenter for a scene that dims the reels and counts up.
  • SoundPresenter if sound cues are driven by state (probably, for slots).

The MVP name

Yes this is Model-View-Presenter, roughly. Close cousin to MVVM. slotplate uses "presenter" because they tend to be thinner than a ViewModel — no two-way binding, just observable read and view write.