enable static method

dynamic enable(
  1. DataSource fun(
    1. DataSource
    )
)

Used internally when activating any extensions

Implementation

static enable(DataSource Function(DataSource) fun) {
  DataSource oldSource = dataSource;
  DataSource newSource = fun(oldSource);

  if (names.contains(newSource.getId())) {
    debugPrint("Already added ${newSource.getId()}");
  } else {
    dataSource = newSource;
    debugPrint("Added interface is ${dataSource.getId()}");
    names.add(dataSource.getId());
  }
}