core beginner

Plugin Basics Agent

Focused example showing plugin mount state, plugin signal routes, and plugin-owned state updates.

plugins composition signals coordination l1

Related guides and notebooks

What you’ll learn

  • How plugin mount/2 initializes plugin-owned state.
  • How plugin signal_routes contribute handlers to the agent.
  • How plugin actions update a plugin state slice.

How it works

The NotesPlugin owns the :notes state key and exposes two routed signals:

  • notes.add
  • notes.clear

The LiveView sends these signals through AgentServer.call/2 and renders the plugin state after each call.