PHPackages                             wyrihaximus/react-cache-json - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wyrihaximus/react-cache-json

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wyrihaximus/react-cache-json
============================

JSON encode/decode decorator for react/cache

3.2.0(5y ago)52.2k[1 issues](https://github.com/WyriHaximus/reactphp-cache-json/issues)[5 PRs](https://github.com/WyriHaximus/reactphp-cache-json/pulls)MITMakefilePHP ^8 || ^7.4CI passing

Since Jan 24Pushed 1w ago1 watchersCompare

[ Source](https://github.com/WyriHaximus/reactphp-cache-json)[ Packagist](https://packagist.org/packages/wyrihaximus/react-cache-json)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wyrihaximus-react-cache-json/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (4)Versions (15)Used By (0)

JSON encode/decode decorator for react/cache
============================================

[](#json-encodedecode-decorator-for-reactcache)

[![Continuous Integration](https://github.com/wyrihaximus/reactphp-cache-json/workflows/Continuous%20Integration/badge.svg)](https://github.com/wyrihaximus/reactphp-cache-json/workflows/Continuous%20Integration/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/482d570c7d2f9f944a1e65ee512b05a5740f49de74908c7e83997e32a1d2ec2c/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f72656163742d63616368652d6a736f6e2f762f737461626c652e706e67)](https://packagist.org/packages/wyrihaximus/react-cache-json)[![Total Downloads](https://camo.githubusercontent.com/fe909ede1cb31131563404a0e25a941f7495bed080398127e68084d786539999/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f72656163742d63616368652d6a736f6e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/wyrihaximus/react-cache-json/stats)[![Type Coverage](https://camo.githubusercontent.com/5adcd29ac597a895ef26aafad78040f303bd25bc67ba6c9906c8f07a22993244/68747470733a2f2f73686570686572642e6465762f6769746875622f57797269486178696d75732f72656163747068702d63616368652d6a736f6e2f636f7665726167652e737667)](https://shepherd.dev/github/WyriHaximus/reactphp-cache-json)[![License](https://camo.githubusercontent.com/d934494b6288bff36af12ca62b8bda888d4c4a0ec50b9ad19027d25459438ce0/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f72656163742d63616368652d6a736f6e2f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/react-cache-json)

Installation
============

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/react-cache-json

```

Usage
=====

[](#usage)

Wrap any class implementing `React\Cache\CacheInterface` and it will encode any value you give it to JSON when saving, and decode it back to an array or scalar when fetching:

```
