···11package com.example.util.simpletimetracker.core.extension
2233+/**
44+ * Adds item if it not in the list, otherwise removes it from the list.
55+ */
36fun <T> MutableList<T>.addOrRemove(item: T) {
47 if (item in this) remove(item) else add(item)
58}
···1717 )
1818}
19192020-fun <T> LiveData<T>.post(data: T) =
2121- (this as MutableLiveData).postValue(data)
2222-2320fun <T> LiveData<T>.set(data: T) {
2424- (this as MutableLiveData).value = data
2121+ if (this is MutableLiveData) value = data
2522}