protobuf-es
protobuf-es copied to clipboard
Feature request: mergePartial
Hi team, I really love the work you're doing bringing protobufs to the browser!
Feature request:
One use case we have is using a Message<T>
as the value of our internal state for some of the UI. This works really nicely because it's typed and can be marshalled/unmarshalled easily. However, we often want to deep merge another PartialMessage<T>
into that state. Something like proto3.util.initPartial()
, except instead of replacing nested values it merges them left to right.
Other things we have considered
- Using deepMerge from lodash. Works in
v0.2.x
so long as you don't have any 64bit ints in your schema. Broken inv0.3.x
- Attempted porting initPartial to do a mergePartial, but it was fairly complex. I might give it another go and open a PR.