<?php

namespace App\Service;

use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Update;

class ActivityService
{
    public function __construct(private HubInterface $hub)
    {

    }

    public function sendUpdate(mixed $data): void
    {
        $update = new Update('activity', json_encode($data));
        $this->hub->publish($update);
    }
}
