package it.integry.integrywmsnative.core.utility;

import androidx.databinding.Observable;
import androidx.databinding.ObservableField;

import it.integry.integrywmsnative.core.expansion.RunnableArgs;

public class UtilityObservable {

    public static <T> void addPropertyChanged(ObservableField<T> observableField, RunnableArgs<T> onValueChanged) {
        observableField.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
            @Override
            public void onPropertyChanged(Observable sender, int propertyId) {
                onValueChanged.run(observableField.get());
            }
        });
    }

}
