at-import / Sassy-Maps

Map helper functions for Sass 3.3 and up
MIT License
66 stars 22 forks source link

Add memo-reset function #4

Closed xzyfer closed 7 years ago

xzyfer commented 10 years ago

I work on a framework that use memoisation for looking up settings from our config tree because tree traversal is expensive in sass.

However because the config tree can change at anytime we need to be able to reset the current memo cache for a module.

This is currently possible with Sassy-Maps with $Memoization-Table: (); but it feels hacky.

xzyfer commented 10 years ago

Alternative you can use a global key backed of the unique-id() function to prefix all the memo-get operations but then you end up with a bunch of branches on the memo tree that you don't need taking up memory.

Snugug commented 10 years ago

You don't need map-set-deep here, you should just be able to do map-merge. Otherwise I like this.

xzyfer commented 10 years ago

Correct you are :+1: Patched and rebased

xzyfer commented 7 years ago

Clearing out my open pull requests. This is stale now, and I no longer require it.