tasks method

List<Future<void>> tasks(
  1. JsonData data
)

A mostly private method for Teemo to gather all handlers which match the incoming data from the LCU server.

Implementation

List<Future<void>> tasks(JsonData data) {
  List<Handler> tasks = [];

  this._registeredPaths.forEach((key, value) =>
      {data['uri'].startsWith(key) ? tasks.addAll(value) : {}});

  tasks.addAll(this._registeredUris[data['uri']] ?? []);

  if (tasks.isEmpty) tasks.add(this._defaultBehavior);
  return tasks.map((e) => e(data)).toList();
}