Add some examples to github page

Description

Could you add some examples on how to use core.cache to github readme?

Environment

None

Activity

Show:
Sean Corfield
March 2, 2018, 7:35 AM

Release 0.7.0

Sean Corfield
March 1, 2018, 7:22 AM

I've updated the readme to clarify caches are immutable and to show suggested usage with atom/swap! (note: uses through-cache which is also new in the upcoming release – the current through function does not play well with swap! etc).

Marc Limotte
October 14, 2016, 2:58 PM

@alexmiller
Attaching a diff with a note about cache state and and an example.

Marc Limotte
October 14, 2016, 2:55 PM

I've used this library a few times, and each time I have to re-learn that the cache is not stateful. I think it would be really helpful if this were clearly called out in the README and a trivial example supplied.

Fogus
February 20, 2012, 12:24 AM

Can do. In the meantime checkout how core.memoize uses it at https://github.com/clojure/core.memoize/blob/master/src/main/clojure/clojure/core/memoize.clj#L50

I think I might bring this through fn into core.cache in a more generic way.

Completed

Assignee

Sean Corfield

Reporter

import

Labels

None

Approval

None

Patch

None

Priority

Major