fetch method

dynamic fetch(
  1. String id, {
  2. String? namespace,
  3. String? module,
  4. bool ignoreUndefined = false,
})

Get a top level variable defined in a certain namespace.

Implementation

dynamic fetch(String id,
    {String? namespace, String? module, bool ignoreUndefined = false}) {
  try {
    final nsp = _fetchNamespace(namespace: namespace, module: module);
    final result = nsp.memberGet(id, ignoreUndefined: ignoreUndefined);
    return result;
  } catch (error, stackTrace) {
    if (config.processError) {
      processError(error, stackTrace);
    } else {
      rethrow;
    }
  }
}