Closed florentferry closed 6 years ago
@florentferry looks really nice.
I use this branch on my current project, all looks good for me. I didn't test cached: true
, but I found something incoherent.
In the readme there is cache_key
mentioned (https://github.com/komposable/komponent/pull/84/files#diff-04c6e90faac2675aa89e2176d2eec7d8R139):
+/ or cache the component with a specific key, such as the last update of a model
+= component "button", { text: "Click here" }, cached: true, cache_key: @product.updated_at
But in the renderer, looks like the option is not used (https://github.com/komposable/komponent/pull/84/files#diff-d662fd06dc2cbab92ab384c4af54a041R16). Or may be I simply missed something.
@nicolas-brousse
Yes, it's up to you to choose the key you want to be the cache key. We use cache_key
in our example but any key which change between each rendering should refresh the cache.
Ah! yes, because cache_key
is in options, so used in the final key generation (key = [component, locals, options, cached_block].to_s
).
Sorry then, I read it to quickly.
Nice job!
When do you think to merge this PR and release the pre version?
Current of April, I think. Maybe integrate some others issues into it. But I can release it to prevent to add git
key in Gemfile
.
58, #61, #76, #77, #78, #79, #82