The ResultHandle is perhaps the most interesting class exposed publicly with dcp-client!
Read the source code to find out why! But here are some notes for now:
It extends Array
The constructor actually returns a new instance of a Proxy to it
The proxy overrides any get pretty interestingly
.constructor returns Array.constructor
The following array methods: 'slice', 'filter', 'concat', 'find', 'findIndex', 'indexOf', 'map', 'reduce', 'includes', 'toString', 'forEach' are applied to it as an array and all other array methods are ignored since we don't allow modifications of the ResultHandle
This adds some interesting complexity when dealing with it in Python for Bifrost 2! But I think I'm just overthinking it!
I think there just needs to be a wrapper class in Python which inherits from some non mutable List and behaves how you would expect the ResultHandle to behave. I only hesitate because this means a "sepcial case" when I just wanted to generically wrap ResultHandle like everything else
The ResultHandle is perhaps the most interesting class exposed publicly with dcp-client!
Read the source code to find out why! But here are some notes for now:
.constructor
returnsArray.constructor
'slice', 'filter', 'concat', 'find', 'findIndex', 'indexOf', 'map', 'reduce', 'includes', 'toString', 'forEach'
are applied to it as an array and all other array methods are ignored since we don't allow modifications of the ResultHandleThis adds some interesting complexity when dealing with it in Python for Bifrost 2! But I think I'm just overthinking it!
I think there just needs to be a wrapper class in Python which inherits from some non mutable List and behaves how you would expect the ResultHandle to behave. I only hesitate because this means a "sepcial case" when I just wanted to generically wrap ResultHandle like everything else