Skip to content

Commit 6db22df

Browse files
authored
Merge pull request #10 from yusufshakeel/dev
v1.6.5
2 parents c96756c + 725d686 commit 6db22df

File tree

11 files changed

+844
-50
lines changed

11 files changed

+844
-50
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Cache data using JavaScript in the browser.
55
### Status
66

77
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/yusufshakeel/dyCacheJS)
8-
[![npm version](https://img.shields.io/badge/npm-1.6.0-blue.svg)](https://www.npmjs.com/package/dycachejs)
8+
[![npm version](https://img.shields.io/badge/npm-1.6.5-blue.svg)](https://www.npmjs.com/package/dycachejs)
99
[![Build Status](https://travis-ci.org/yusufshakeel/dyCacheJS.svg?branch=master)](https://travis-ci.org/yusufshakeel/dyCacheJS)
1010
[![](https://data.jsdelivr.com/v1/package/npm/dycachejs/badge)](https://www.jsdelivr.com/package/npm/dycachejs)
1111

dist/js/dyCache.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,32 @@ <h4><code>LRUInit(name, size)</code></h4>
14621462

14631463
<hr>
14641464

1465+
<!-- LRUExists() -->
1466+
<a name="LRUExists"></a>
1467+
<h4><code>LRUExists(name)</code></h4>
1468+
1469+
<p>This will check if the LRU object
1470+
referred by <code>name</code> exists in the cache.</p>
1471+
1472+
<p>Returns <code>true</code> on success, <code>false</code> otherwise.</p>
1473+
1474+
<pre><code>obj.LRUExists('myLRU');</code></pre>
1475+
1476+
<div>
1477+
<a class="btn btn-primary"
1478+
role="button"
1479+
data-toggle="collapse"
1480+
href="#collapse-LRUExists"
1481+
aria-expanded="false"
1482+
aria-controls="collapse-LRUExists">Output</a>
1483+
</div>
1484+
<div class="collapse" id="collapse-LRUExists">
1485+
</div>
1486+
1487+
<!-- LRUExists() ends here -->
1488+
1489+
<hr>
1490+
14651491
<!-- LRUSet() -->
14661492
<a name="LRUSet"></a>
14671493
<h4><code>LRUSet(name, key, value)</code></h4>
@@ -1526,6 +1552,93 @@ <h4><code>LRUGet(name, key)</code></h4>
15261552

15271553
<hr>
15281554

1555+
<!-- LRUResize() -->
1556+
<a name="LRUResize"></a>
1557+
<h4><code>LRUResize(name, size)</code></h4>
1558+
1559+
<p>This will resize the LRU object
1560+
referred by <code>name</code> in the cache.</p>
1561+
1562+
<p>If <code>size</code> is not mentioned then LRU object is resized to 3.</p>
1563+
1564+
<p>If new <code>size</code> is less than the current size then,
1565+
first 'size'-th key is kept in the queue and data set and rest of the keys are removed.</p>
1566+
1567+
<p>For example, if current size is 10 and new size is 4,
1568+
then first 4 key is retained in the data set and queue while the
1569+
remaining keys are removed.</p>
1570+
1571+
<p>Returns <code>true</code> on success, <code>false</code> otherwise.</p>
1572+
1573+
<pre><code>obj.LRUResize('myLRU', 2);</code></pre>
1574+
1575+
<div>
1576+
<a class="btn btn-primary"
1577+
role="button"
1578+
data-toggle="collapse"
1579+
href="#collapse-LRUResize"
1580+
aria-expanded="false"
1581+
aria-controls="collapse-LRUResize">Output</a>
1582+
</div>
1583+
<div class="collapse" id="collapse-LRUResize">
1584+
</div>
1585+
1586+
<!-- LRUResize() ends here -->
1587+
1588+
<hr>
1589+
1590+
<!-- LRUPurge() -->
1591+
<a name="LRUPurge"></a>
1592+
<h4><code>LRUPurge(name)</code></h4>
1593+
1594+
<p>This will purge the LRU object
1595+
referred by <code>name</code> in the cache.</p>
1596+
1597+
<p>Returns <code>true</code> on success, <code>false</code> otherwise.</p>
1598+
1599+
<pre><code>obj.LRUPurge('myLRU');</code></pre>
1600+
1601+
<div>
1602+
<a class="btn btn-primary"
1603+
role="button"
1604+
data-toggle="collapse"
1605+
href="#collapse-LRUPurge"
1606+
aria-expanded="false"
1607+
aria-controls="collapse-LRUPurge">Output</a>
1608+
</div>
1609+
<div class="collapse" id="collapse-LRUPurge">
1610+
</div>
1611+
1612+
<!-- LRUPurge() ends here -->
1613+
1614+
<hr>
1615+
1616+
<!-- LRUDelete() -->
1617+
<a name="LRUDelete"></a>
1618+
<h4><code>LRUDelete(name)</code></h4>
1619+
1620+
<p>This will delete the LRU object
1621+
referred by <code>name</code> from the cache.</p>
1622+
1623+
<p>Returns <code>true</code> on success, <code>false</code> otherwise.</p>
1624+
1625+
<pre><code>obj.LRUDelete('myLRU');</code></pre>
1626+
1627+
<div>
1628+
<a class="btn btn-primary"
1629+
role="button"
1630+
data-toggle="collapse"
1631+
href="#collapse-LRUDelete"
1632+
aria-expanded="false"
1633+
aria-controls="collapse-LRUDelete">Output</a>
1634+
</div>
1635+
<div class="collapse" id="collapse-LRUDelete">
1636+
</div>
1637+
1638+
<!-- LRUDelete() ends here -->
1639+
1640+
<hr>
1641+
15291642

15301643
</div>
15311644

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dycachejs",
3-
"version": "1.6.0",
3+
"version": "1.6.5",
44
"description": "Cache data using JavaScript in the browser.",
55
"main": "index.html",
66
"scripts": {

0 commit comments

Comments
 (0)