fun-map icon indicating copy to clipboard operation
fun-map copied to clipboard

Default wrappers can be configured by individual fun-maps

Open robertluo opened this issue 2 years ago • 2 comments

Problem

Default wrappers are hard-coded now; the only way to change them for individual entries is by writing them everywhere.

robertluo avatar Jan 31 '23 17:01 robertluo

I was curious about the wrappers system. I went digging through the code and the docs, but couldn't quite wrap my head around how to use the wrappers key most effectively. I'm finding "trace" adds to the fun of the fun-map quite a bit.

Let's see if I get where we are. In order to add a new default wrapper;

  1. you fork fun-map
  2. write a new type implementing ValueWrapper protocol
  3. add a new method to wrapper/fw-impl
  4. throw the dispatch key inside the fw macro itself? (helper/make-fw-wrapper wrapper/fun-wrapper [:trace :cache :newness] arg-map body)`

If I'm reading the code wrong, please let me know what I missed. If I'm up to speed, I'd like to work on solving this issue with you. Do you have any ideas?

patbrown avatar Jan 06 '24 16:01 patbrown

You read the code correctly. It seems like there could be a more efficient way to implement this.

robertluo avatar Jan 07 '24 06:01 robertluo