Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ngx-cache-if
Advanced tools
Angular *ngIf directive that cache content. *ngxCacheIf directive render content when needed and cache it for reuse.
This directive to fill the gap between legacy *ngIf structural directive and [hidden] directive. ngxCacheIf will behave like a ngIf for the first rendering then will act has hidden/shown directive. This allow to render a component only when needed and keep it's result in cache if we need to hide it again. (conditionnal content).
Tested with :
Framwork | Version |
---|---|
Angular | 5 + |
Ionic | 3 |
npm i --save ngx-cache-if
import NgxCacheIfModule in your app module.
<my-comp async *ngxCacheIf="state"></my-comp>
Url : https://mkligknn.github.stackblitz.io
StackBlitz : https://stackblitz.com/edit/ngx-cache-if
By default ngIf diretive render the component each time you want to display it. And destroy it when you hide it. This cause the lifecycle events to trigger multiple time if you display the same content. (An async call made in ngOnInit for example).
The hidden/shown behaviors renders the element at the rendering of the parent component and hide or display it with css. This cause the lifecycle events to be triggered at the rendering of the parent view. If you have multiples components to load in the same view that can cause a large amount of operations if they are computing all at the same time instead of rendering only when needed.
FAQs
Angular *ngIf directive that cache content. *ngxCacheIf directive render content when needed and cache it for reuse.
The npm package ngx-cache-if receives a total of 28 weekly downloads. As such, ngx-cache-if popularity was classified as not popular.
We found that ngx-cache-if demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.