Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A use case I had for proxies was a circular array type:

https://github.com/philbooth/hoopy

If the index overflows in either direction, loop back round to the start/end of the array. I wanted a circular array to use as a fixed-length buffer for receiving data in a streaming JSON parser I wrote:

https://github.com/philbooth/bfj/blob/61087c194d5675c75569a2...



A circular array type, love it! It looks like an excellent use case of proxies.


Technically the type should still be an Array with the backing implementation having a circular array behavior no?



Cool. I was seeing source of inner js, which in deed uses proxies to create structural sharing.

https://github.com/mweststrate/immer




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: