Skip to content

Commit 771d547

Browse files
authored
Merge pull request #62 from Terreii/view
update useView
2 parents 48a74e8 + d977b70 commit 771d547

15 files changed

+12127
-16464
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
extends: [
66
'eslint:recommended',
77
'plugin:@typescript-eslint/recommended',
8-
'prettier/@typescript-eslint',
8+
'prettier',
99
'plugin:react/recommended',
1010
'plugin:react-hooks/recommended',
1111
'plugin:jest/recommended',

.github/workflows/documentation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
if: github.event_name != 'push'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
15-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
1616
with:
1717
node-version: '14.x'
1818
- name: Lint
@@ -28,8 +28,8 @@ jobs:
2828
if: github.event_name != 'pull_request'
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v1
32-
- uses: actions/setup-node@v1
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-node@v2
3333
with:
3434
node-version: '14.x'
3535
- name: Release to GitHub Pages

.github/workflows/node.js.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [latest]
1111

1212
jobs:
13-
build:
13+
test:
1414
runs-on: ubuntu-latest
1515

1616
strategy:
@@ -29,3 +29,22 @@ jobs:
2929
- run: npm run build
3030
- run: npm run test-ci
3131
- run: npm run lint
32+
33+
publish:
34+
# Only release on push to latest
35+
if: github.event_name == 'push' && github.ref == 'refs/heads/latest'
36+
runs-on: ubuntu-latest
37+
# Waits for test jobs for each Node.js version to complete
38+
needs: test
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: actions/setup-node@v2
42+
with:
43+
node-version: '14.x'
44+
cache: 'npm'
45+
- run: npm ci
46+
- name: Release
47+
run: npx semantic-release
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
50+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

docs/api/use-view.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ descriptions are copied from the PouchDB API page.
3838
- A full CouchDB-style map/reduce view `{map: ..., reduce: ...}`. **Danger! It will scan the _entire database_
3939
every time a parameter or document did change! Use only for development!**
4040
2. `options?: object` - An options object. It has the same options as
41-
[`db.query()`](https://pouchdb.com/api.html#query_database) with the exception that `options.stale` is not yet
42-
implemented.
41+
[`db.query()`](https://pouchdb.com/api.html#query_database).
4342
- `options.reduce?: boolean` - Should the result be reduced by the defined `reduce` function? Defaults to `true`.
4443
- `true` - Return the result of the reduce function.
4544
- `false` - Don't use the reduce function.
@@ -70,6 +69,10 @@ descriptions are copied from the PouchDB API page.
7069
returning a single result. Defaults to `false`.
7170
- `options.group_level?: number` - Number of elements in a key to group by, assuming the keys are arrays.
7271
Defaults to the full length of the array.
72+
- `options.stale?: 'ok' | 'update_after'` - Only applies to saved views. Can be one of:
73+
- unspecified (default): Returns the latest results, waiting for the view to build if necessary.
74+
- `'ok' | 'update_after'`: Returns results immediately, even if they’re out-of-date.
75+
But starts a new request after the first request did resolved.
7376
- `options.update_seq?: boolean` - Include an `update_seq` value indicating which sequence id of the underlying
7477
database the view reflects.
7578
- `options.db?: string` - Selects the database to be used. The database is selected by it's name/key.

node-tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@tsconfig/node10/tsconfig.json",
2+
"extends": "@tsconfig/node12/tsconfig.json",
33
"compilerOptions": {
44
"jsx": "react",
55
"declaration": true,

0 commit comments

Comments
 (0)