Go to file
Evgeny Kuzyakov dd0afdeae2
Merge pull request #106 from NearSocial/no-stale
- Add `cacheOptions` optional argument to the following methods:
  - `Social.get(keys, blockId|finality, options, cacheOptions)`
  - `Social.getr(keys, blockId|finality, options, cacheOptions)`
  - `Social.keys(keys, blockId|finality, options, cacheOptions)`
  - `Social.index(action, key, options, cacheOptions)`
  - `Near.view(contractName, methodName, args, blockId|finality, subscribe, cacheOptions)`
  - `Near.block(blockId|finality, subscribe, cacheOptions)`
The `cacheOptions` object is optional and may contain the following property:
  - `ignoreCache` - boolean, if true, the method will ignore the cached value in the local DB and fetch the data from the API server. This will only happen once per session. Default is false.

This is useful to avoid loading stale objects that are likely to change often. For example, the index of posts for the main feed, or notifications.
```jsx
const index = Social.index(
  "post",
  "main",
  {
    limit: 10,
    order: "desc",
  },
  {
    ignoreCache: true,
  }
);
```
2023-09-11 10:02:51 -07:00
.github/workflows Cleanup 2023-05-30 14:05:20 +02:00
config Move VM to root 2023-02-16 09:59:08 -08:00
dist Merge branch 'dev' of github.com:NearSocial/VM into no-stale 2023-09-08 09:17:08 -07:00
src Merge branch 'dev' of github.com:NearSocial/VM into no-stale 2023-09-08 09:17:08 -07:00
.babelrc Move VM to root 2023-02-16 09:59:08 -08:00
.gitignore Add babel-loader and dist 2023-02-16 10:26:22 -08:00
CHANGELOG.md Merge branch 'dev' of github.com:NearSocial/VM into no-stale 2023-09-08 09:17:08 -07:00
LICENSE Initial template based on wiki 2022-08-23 16:21:20 -07:00
package.json Replace lodash dep with lodash.clonedeep 2023-08-27 18:58:52 -07:00
webpack.config.js Move VM to root 2023-02-16 09:59:08 -08:00
yarn.lock Replace lodash dep with lodash.clonedeep 2023-08-27 18:58:52 -07:00