//
// Copyright © 2023 Nevis Security AG. All rights reserved.
//

actor DeregistrationOperation: StandardOperation {
	typealias T = ()

	// MARK: Properties

	private(set) var state: OperationState
	let onSuccess: SuccessHandler
	let onError: ErrorHandler

	// MARK: Initialization

	init(operationId: String, method: ReactMethod) {
		self.state = NoOperationState()
		self.onSuccess = OnSuccessImpl(operationId: operationId, method: method).onSuccess
		self.onError = OnErrorImpl(operationId: operationId, method: method).onError
	}

	// MARK: Public Interface

	func update(state: UserInteractionState) -> DeregistrationOperation {
		self.state = state
		return self
	}
}
