Skip to content

Commit

Permalink
feat: Added <Provider> Component 'max' prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenChang618 committed Sep 25, 2019
1 parent a8c0e0d commit d8a3031
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 49 deletions.
46 changes: 0 additions & 46 deletions LICENSE.996ICU

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Since the cached components need to be stored, the `<Provider>` must be rendered

`exclude`: Any component that matches key will not be cached. It can be a string, an array of strings, or a regular expression.

`max`: If the maximum value is set, the value in the cache is deleted after it goes out.
`max`(`v2.5.2+`): If the maximum value is set, the value in the cache is deleted after it goes out.

#### Example
In the example below, the <App /> component is our root-level component. This means it’s at the very top of our component hierarchy.
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h1 align="center">React Keep Alive</h1>
<div align="center">

[![npm](https://img.shields.io/npm/v/react-keep-alive.svg?style=for-the-badge)](https://www.npmjs.com/package/react-keep-alive) [![Travis (.org)](https://img.shields.io/travis/Sam618/react-keep-alive.svg?style=for-the-badge)](https://travis-ci.org/Sam618/react-keep-alive.svg?branch=master) [![LICENSE](https://img.shields.io/npm/l/react-keep-alive.svg?style=for-the-badge)](https://github.com/Sam618/react-keep-alive/blob/master/LICENSE.MIT) [![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg?style=for-the-badge)](https://github.com/Sam618/react-keep-alive/blob/master/LICENSE.996ICU) [![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/react-keep-alive.svg?style=for-the-badge)](https://www.npmjs.com/package/react-keep-alive) [![downloads](https://img.shields.io/npm/dm/react-keep-alive.svg?style=for-the-badge)](https://www.npmjs.com/package/react-keep-alive) [![typescript](https://img.shields.io/badge/language-typescript-blue.svg?style=for-the-badge)](https://www.typescriptlang.org/) [![996.icu](https://img.shields.io/badge/link-996.icu-red.svg?style=for-the-badge)](https://996.icu)
[![npm](https://img.shields.io/npm/v/react-keep-alive.svg?style=for-the-badge)](https://www.npmjs.com/package/react-keep-alive) [![Travis (.org)](https://img.shields.io/travis/Sam618/react-keep-alive.svg?style=for-the-badge)](https://travis-ci.org/Sam618/react-keep-alive.svg?branch=master) [![LICENSE](https://img.shields.io/npm/l/react-keep-alive.svg?style=for-the-badge)](https://github.com/Sam618/react-keep-alive/blob/master/LICENSE.MIT) [![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/react-keep-alive.svg?style=for-the-badge)](https://www.npmjs.com/package/react-keep-alive) [![downloads](https://img.shields.io/npm/dm/react-keep-alive.svg?style=for-the-badge)](https://www.npmjs.com/package/react-keep-alive) [![typescript](https://img.shields.io/badge/language-typescript-blue.svg?style=for-the-badge)](https://www.typescriptlang.org/)


<p><a href="https://nodei.co/npm/react-keep-alive/"><img src="https://nodei.co/npm/react-keep-alive.png?downloads=true&downloadRank=true&stars=true"></a></p>
Expand Down Expand Up @@ -89,7 +89,7 @@ ReactDOM.render(

`exclude`:任何匹配 `key` 的组件都不会被缓存。它可以是字符串,字符串数组或正则表达式。

`max`:如果设置了最大值,那么在超出最大值之后就会删除缓存中的值。
`max`(`v2.5.2+`):如果设置了最大值,那么在超出最大值之后就会删除缓存中的值。

#### 例子
在下面的示例中,`<App />` 是我们的根组件,这意味着它位于组件层次结构的最顶层。
Expand Down

0 comments on commit d8a3031

Please sign in to comment.