pamelafox/lscache — pull request #14 by mattpowell (2012-04-17 18:59:00+00:00)
Title: Basic bucketing support

The idea behind this change is to allow people running lscache from multiple pages/apps on the same domain to bucket their data in to different "storage areas". This doesn't necessarily protect your keys from being overwritten, but, could help. It also definitely makes it easier to flush a specific set of keys.

I contemplated two different techniques: adding an additional `bucket` parameter to the `set`/`get`/`remove`/`flush` methods; or adding in a `keys` method that returned back `null` for unsupported browsers and an array of keys for supported browsers. Ultimately, I went w/ `setBucket` because it's a simple call that could be made in some global config somewhere.

The original tests plus two new tests pass locally. Also, I kept my changes to README minimal because I know some people prefer to update that themselves :)

Thanks, and lmk if you have ?'s.