register method
Registers codec, replacing any existing codec for its type.
Implementation
void register(ComponentCodec codec) {
final previous = _byType[codec.type];
if (previous != null &&
identical(_byComponentType[previous.componentType], previous)) {
_byComponentType.remove(previous.componentType);
}
_byType[codec.type] = codec;
if (codec.componentType != Component) {
_byComponentType[codec.componentType] = codec;
}
}