// Copyright (c) 2025-2026 GeWuYou
// SPDX-License-Identifier: Apache-2.0

using GFramework.Core.Abstractions.Events;

namespace GFramework.Core.Configuration;

/// <summary>
///     配置监听取消注册接口
/// </summary>
internal sealed class ConfigWatcherUnRegister : IUnRegister
{
    private readonly Action _unRegisterAction;

    public ConfigWatcherUnRegister(Action unRegisterAction)
    {
        _unRegisterAction = unRegisterAction ?? throw new ArgumentNullException(nameof(unRegisterAction));
    }

    public void UnRegister()
    {
        _unRegisterAction();
    }
}