Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

.nornir/assets/elm-loop.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 300" font-family="-apple-system,Segoe UI,Roboto,sans-serif" font-size="15">
  <defs>
    <marker id="a" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto">
      <path d="M0,0 L7,3 L0,6 Z" fill="#555"/>
    </marker>
  </defs>
  <!-- Model -->
  <rect x="40" y="120" width="150" height="60" rx="8" fill="#eef3fb" stroke="#2b5fb3" stroke-width="1.5"/>
  <text x="115" y="146" text-anchor="middle" font-weight="600">Model</text>
  <text x="115" y="166" text-anchor="middle" fill="#555" font-size="12">all observable state</text>
  <!-- view -->
  <rect x="300" y="40" width="170" height="60" rx="8" fill="#eefaf0" stroke="#2f8f4e" stroke-width="1.5"/>
  <text x="385" y="66" text-anchor="middle" font-weight="600">view(&amp;self)</text>
  <text x="385" y="86" text-anchor="middle" fill="#555" font-size="12">pure · paints · → Vec&lt;Msg&gt;</text>
  <!-- update -->
  <rect x="300" y="200" width="170" height="60" rx="8" fill="#fdf2ec" stroke="#c26a2b" stroke-width="1.5"/>
  <text x="385" y="226" text-anchor="middle" font-weight="600">update(&amp;mut self, Msg)</text>
  <text x="385" y="246" text-anchor="middle" fill="#555" font-size="12">the ONLY mutation → Vec&lt;Effect&gt;</text>
  <!-- Effect -->
  <rect x="580" y="200" width="140" height="60" rx="8" fill="#f6eefb" stroke="#7a3fb3" stroke-width="1.5"/>
  <text x="650" y="226" text-anchor="middle" font-weight="600">Effect</text>
  <text x="650" y="246" text-anchor="middle" fill="#555" font-size="12">side work as data</text>
  <!-- arrows: Model -> view -->
  <path d="M150,120 C210,70 250,70 300,70" fill="none" stroke="#555" stroke-width="1.5" marker-end="url(#a)"/>
  <text x="215" y="80" fill="#2f8f4e" font-size="12">reads state</text>
  <!-- view -> update (Msgs) -->
  <path d="M420,100 C450,140 450,160 400,200" fill="none" stroke="#555" stroke-width="1.5" marker-end="url(#a)"/>
  <text x="470" y="152" fill="#c26a2b" font-size="12">emits Msg</text>
  <!-- update -> Model -->
  <path d="M300,230 C230,230 200,220 165,180" fill="none" stroke="#555" stroke-width="1.5" marker-end="url(#a)"/>
  <text x="205" y="222" fill="#2b5fb3" font-size="12">mutates</text>
  <!-- update -> Effect -->
  <path d="M470,230 L580,230" fill="none" stroke="#555" stroke-width="1.5" marker-end="url(#a)"/>
  <!-- bridge label -->
  <text x="385" y="150" text-anchor="middle" fill="#888" font-size="12" font-style="italic">Facet::ui bridge:</text>
  <text x="385" y="168" text-anchor="middle" fill="#888" font-size="12" font-style="italic">for m in view(ui) { update(m) }</text>
  <text x="40" y="28" font-weight="700" font-size="16">The Elm loop — facett FC-2 / FC-9</text>
</svg>