DEV Community

Discussion on: Codetip - Javascript: Hide Dependency to a Data Structure

Collapse
 
hdennen profile image
Harry Dennen

@Proxy in JS is great for exactly this. Using a generic proxy decorator, you can create custom proxy classes to instantiate the objects you need from the responses you get.

Collapse
 
avraammavridis profile image
Avraam Mavridis

Needs a polyfill though.

Collapse
 
hdennen profile image
Harry Dennen

Yep. polyfill.io ? never used it but certainly seems cool.