You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How do if(<expression>) guard patterns interact with array/object pattern caches? #321
What will be logged—"fully cached" because the if expression uses the cached results for both getting subject.iterable and for getting an iterator for that, "partially cached" because the if expression does not use cached results for the first Get but still remembers results from the iterator, or "uncached" because e.g. the if expression is independent of caching?
On a rethink, it wouldn't make any sense to do this - I think the if part is "just javascript" and the caching doesn't apply there. If you want the cache, use a binding in the pattern.
Activity
ljharb commentedon Mar 18, 2024
I would expect "fully cached" - any implicit iteration done by patterns should be populating and using the cache.
ljharb commentedon Sep 6, 2024
On a rethink, it wouldn't make any sense to do this - I think the
ifpart is "just javascript" and the caching doesn't apply there. If you want the cache, use a binding in the pattern.gibson042 commentedon Sep 7, 2024
Does your rethink lead you to "partially cached" or to "uncached"?
ljharb commentedon Sep 7, 2024
Uncached. Caching only applies in patterns.