register static method

void register(
  1. Map<String, DuckComponentParser> componentParsers
)

Registers component parsers for the given map of component types.

This allows consuming apps (like duckrunner) to add their own components to the registry. If a parser for any given component type already exists, it will be overwritten.

Example usage:

DuckComponentRegistry.register({
  MyCustomData.componentType: MyCustomData.fromJson,
  AnotherCustomData.componentType: AnotherCustomData.fromJson,
});

Implementation

static void register(Map<String, DuckComponentParser> componentParsers) {
  parsers.addAll(componentParsers);
}