This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains some improvements to
mdMedia
, split-up in 3 commits as follows:fix(mdUtil): remove/delete cacheFactory keys when clearing/destroying cache:
mdUtil
's customcacheFactory
factory, adds/removes keys when putting/removing a single key, but leaveskeys
untouched when callingremoveAll()
ordestroy()
. As a result, the following problems arise:keys()
method return incorrect results after callingremoveAll()
(i.e. it continues to return the old keys, although they are not present in the cache any more).This commit fixes these issues, by overriding the
removeAll
anddestroy
methods as well.fix(mdMedia): avoid unnecessary digest and make changes apply quicker:
Previously, the
updateAll()
method relied on$timeout
for scheduling a digest. This made the possible changes apply after the next rendering and could possibly lead to extra digests.This commit, replaces the call to
$timeout
with a call to$evalAsync()
, which avoids an extra digest if one is already in progress and also applies the changes before the next rendering.test(mdMedia): add more tests and move .spec file to correct location:
In commit 6397040
mdMedia
was moved out of thesidenav
component and intocore
. The .spec file remained in the original folder though.*This commit moves the 'media.spec.js
file to the correct location and adds more tests to more thoroughly cover
mdMedia`'s functionality.* Since this commit, the file has been moved ot the right location in cfd48f8.