package com.tofly.ghrq_route.common.util;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by hasee on 2018/3/21.
 */

public class EventBusUtil {
    public static void register(Object subscribe){
        if (!EventBus.getDefault().isRegistered(subscribe))
            EventBus.getDefault().register(subscribe);
    }

    public static void unregister(Object subscribe){
        if (EventBus.getDefault().isRegistered(subscribe))
            EventBus.getDefault().unregister(subscribe);
    }

    public static void postEvent(Object event){
        EventBus.getDefault().post(event);
    }
}
