Create extendable
object
#2239
Replies: 3 comments 1 reply
-
Interesting idea! Not sure this pattern scales very well though so would need to think about if we want to add it to additional types. Also, not sure it's worth exporting this API from Viem as it doesn't really mesh with the surface area that Viem's public API covers. |
Beta Was this translation helpful? Give feedback.
-
I agree with this it would actually make more sense for extendable to be it's own package I think |
Beta Was this translation helpful? Give feedback.
-
ok i'll make this in tevm repo and circle back later to see if sharing code makes sense |
Beta Was this translation helpful? Give feedback.
-
Viem uses a decorator pattern to add functionality to a base client using
extend
. It's a nice pattern that tevm follows for both it's clients and it's lower level primitive to allow better code splitting. One of many examplesIdea here is to seperate
extendable
into it's own lower level primitive that Tevm and anyone else can reuse. I might even suggest making transports and some other objects in Viem extendable.Beta Was this translation helpful? Give feedback.
All reactions