-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tpl: Add "cached" piped option #3417
Comments
In other words: the partialCached func could become more generic in the sense that it could also cache / handle more things than just templates in the future, right? |
No, turn it around: It is the |
So, |
Yes. Maybe not relevant for partial, but for, say, images, one could imagine piping several "action options"; But even in the partial case, it makes a cleaner API. |
Do you want to cache a composition of template functions this way? |
No. |
And the slightly longer version is: I would love to come up with a generic "cache func" (how-to-suggestion welcome), but this is just options sent into another func (which can be accumulated). So both of these are the same:
The reason we added the Then you may end up with:
And this breaks down fast if you need some additional and optional cache key etc. So:
And please don't ask me what |
I agree and understand the reasoning, but the proposed implementation doesn't make sense. With
the |
I haven't proposed an implementation, just the API. |
But this isn't really important. Let it linger. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See #3042
The
partialCached
template func name makes for a bad API.It would be nice if we could say:
We would keep the old func as an alias, and this keyword would only work for the
partial
func at the start, but one could imagine we could use it for other things, and maybe add more "options" later.I guess this would only work for funcs with "vararg room" on the end.
The text was updated successfully, but these errors were encountered: