The correct way to call repaint() for a SliderAttachment?

heres an example of what im trying, which is currently causing some problems.

quick edit: my painting is probably the bigger issue, i think i just need to cache the drawings to prevent redrawing unchanged images.

// header class
**Editor : public juce::AudioProcessorValueTreeState::Listener, public juce::Timer

// header functions
void parameterChanged(const String& parameterID, float newValue) override;
void timerCallback() override;

// header private members
juce::Slider sliderExample;
std::unique_ptr<juce::AudioProcessorValueTreeState::SliderAttachment> attachmentExample;
juce::Atomic<bool> exampleChange{ false };

-------------------------------------------------------------

// cpp constructor
audioProcessor.apvts.addParameterListener("ID_Band1_Freq", this);
attachmentExample.reset(new AudioProcessorValueTreeState::SliderAttachment{ audioProcessor.apvts, "ID_Band1_Freq", sliderExample });

startTimerHz(30);

// cpp destructor
attachmentExample.reset(nullptr);

// timer callback
if (paramChanged.compareAndSetBool(false, true)) 
    {
        repaint();
    }

// param changed function
paramChanged.set(true); 

this is probably not a great way to do things because there is slight lagging occurring when moving a slider. What would be the correct way?