protobuf.js version: 6.2.1
Enums are a common thing used across our code. in v5. I would be able to do things like
import { MyMessage } from 'protos';
if (something === MyMessage.Type.CAT) {
// Do something.
}
The same thing now is
import root from 'protos';
const MyMessage = root.lookup('MyMessage');
const Type = MyMessage.lookup('Type');
if (something === Type.values.CAT) {
}
I like the lookup pattern for messages, I understands its pros. But for enums its very clunky when you have values in between.
Can enums live in its own shadow hierarchy? which makes it easy to do something like.
import { MyMessage: { Type } } from 'enums';
if (something === Type.CAT) {
// Do something.
}
protobuf.js version: 6.2.1
Enums are a common thing used across our code. in v5. I would be able to do things like
The same thing now is
I like the lookup pattern for messages, I understands its pros. But for enums its very clunky when you have values in between.
Can enums live in its own shadow hierarchy? which makes it easy to do something like.