Skip to content

Commit

Permalink
Fix bad example on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gndelia committed May 9, 2024
1 parent 5899f01 commit da12401
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/eth-rpc-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ const cachedProvider = {
Object.setPrototypeOf(cachedProvider, Object.getPrototypeOf(cachedProvider))

// Will call the RPC endpoint and retrieve the chainId
await provider.send('eth_chainId', [])
await cachedProvider.send('eth_chainId', [])
// Will retrieve the value from the cache, and while the instance is alive, it will permanently be cached
await provider.send('eth_chainId', [])
await cachedProvider.send('eth_chainId', [])
// Will call the RPC endpoint and retrieve the current number
await provider.send('eth_blockNumber', [])
await cachedProvider.send('eth_blockNumber', [])
// This value will be cached for ~half block, so if requested again before that time passes, it will come from the cache
await provider.send('eth_blockNumber', [])
await cachedProvider.send('eth_blockNumber', [])
```

## API
Expand Down

0 comments on commit da12401

Please sign in to comment.