#9 Added type-safe UI dispatch system