Skip to content

Commit c493040

Browse files
committed
Tweaking headers
1 parent 1caa70c commit c493040

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,13 @@ Imagine your cache is a box that can only fit a certain number of items. When th
2828
4. If the program needs something, it checks the cache first before doing extra work.
2929

3030

31-
## For Developers
32-
33-
Below are technical details and code examples for those who want to use Tiny LRU in their code.
34-
35-
### Using Tiny LRU in Code
36-
37-
#### Using the factory
31+
## Using the factory
3832
```javascript
3933
import {lru} from "tiny-lru";
4034
const cache = lru(max, ttl = 0, resetTtl = false);
4135
```
4236

43-
#### Using the Class
37+
## Using the Class
4438
```javascript
4539
import {LRU} from "tiny-lru";
4640
const cache = new LRU(max, ttl = 0, resetTtl = false);
@@ -51,18 +45,17 @@ import {LRU} from "tiny-lru";
5145
class MyCache extends LRU {}
5246
```
5347

54-
#### Interoperability
48+
## Interoperability
5549
Lodash provides a `memoize` function with a cache that can be swapped out as long as it implements the right interface.
5650
See the [lodash docs](https://lodash.com/docs#memoize) for more on `memoize`.
5751

58-
Example:
5952
```javascript
6053
_.memoize.Cache = lru().constructor;
6154
const memoized = _.memoize(myFunc);
6255
memoized.cache.max = 10;
6356
```
6457

65-
#### Testing
58+
## Testing
6659
Tiny-LRU has 100% code coverage with its tests.
6760

6861
```console

0 commit comments

Comments
 (0)