createRxValue<T, R extends Rx<T>> static method

R createRxValue<T, R extends Rx<T>>(
  1. T defaultValue
)

Implementation

static R createRxValue<T, R extends Rx<T>>(T defaultValue) {
  switch (T) {
    case int:
      return RxInt(defaultValue as int) as R;
    case double:
      return RxDouble(defaultValue as double) as R;
    case bool:
      return RxBool(defaultValue as bool) as R;
    case String:
      return RxString(defaultValue as String) as R;
    default:
      return Rx<T>(defaultValue) as R;
  }
}