Gathering detailed insights and metrics for replicache-react
Gathering detailed insights and metrics for replicache-react
Gathering detailed insights and metrics for replicache-react
Gathering detailed insights and metrics for replicache-react
replicache-react-util
@react-native-replicache/react-native-quick-sqlite
> Plug-in React Native compatibility bindings for [Replicache](https://replicache.dev/).
@react-native-replicache/replicache-generic-sqlite
> Plug-in React Native compatibility bindings for [Replicache](https://replicache.dev/).
@react-native-replicache/react-native-expo-sqlite
> Plug-in React Native compatibility bindings for [Replicache](https://replicache.dev/).
npm install replicache-react
Typescript
Module System
Node Version
NPM Version
70
Supply Chain
80.5
Quality
82.2
Maintenance
100
Vulnerability
99.6
License
TypeScript (87.42%)
JavaScript (12.58%)
Total Downloads
765,380
Last Day
352
Last Week
4,932
Last Month
21,702
Last Year
459,037
23 Stars
78 Commits
8 Forks
5 Watching
4 Branches
7 Contributors
Minified
Minified + Gzipped
Latest Version
5.0.1
Package Id
replicache-react@5.0.1
Unpacked Size
8.17 kB
Size
3.40 kB
File Count
5
NPM Version
8.19.3
Node Version
18.13.0
Publised On
01 Dec 2023
Cumulative downloads
Total Downloads
Last day
-62.3%
352
Compared to previous day
Last week
-4.7%
4,932
Compared to previous week
Last month
0.1%
21,702
Compared to previous month
Last year
102.6%
459,037
Compared to previous year
npm i replicache-react
Build your UI using subscribe()
(or useSubscribe
in React).
Whenever the data in Replicache changes — either due to changes in this tab, another tab, or on the server — the affected UI automatically updates.
Replicache only refires subscriptions when the query results have actually changed, eliminating wasteful re-renders.
React hook that allows you monitor replicache changes
Parameter | Type | Description |
---|---|---|
rep | Replicache | Replicache instance that is being monitored |
query | (tx: ReadTransaction) => Promise | Query that retrieves data to be watched |
def | R | default value returned on first render or whenever query returns undefined |
deps | Array | OPTIONAL: list of dependencies, query will be rerun when any of these change |
example of useSubscribe
in todo app that is watching a specific category
1const {category} = props; 2const todos = useSubscribe( 3 replicache, 4 tx => 5 tx 6 .scan({prefix: `/todo/${category}`}) 7 .values() 8 .toArray(), 9 [], 10 [category], 11); 12 13return ( 14 <ul> 15 {todos.map(t => ( 16 <li>{t.title}</li> 17 ))} 18 </ul> 19);
This release changes the semantics of def
slightly. In previous releases, def
was returned only until query
returned, then useSubscribe
returns query
's result. Now, def
is returned initially, but also if query
returns undefined
.
This is an ergonomic benefit because it avoids having to type the default in two places. Before:
1useSubscribe(r, tx => (await tx.get('count')) ?? 0, 0);
now:
1useSubscribe(r, tx => tx.get('count'), 0);
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
9 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More