Skip to content

Commit c3db9d7

Browse files
authored
Feature/new premium (pubkey#4156)
* ADD stuff * CHORE * CHORE * FIX more stuff * FIX lint * FIX link
1 parent 4847dea commit c3db9d7

File tree

10 files changed

+1354
-133
lines changed

10 files changed

+1354
-133
lines changed

config/landingpage.webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
44
const CopyPlugin = require('copy-webpack-plugin');
55

66
module.exports = {
7-
entry: './docs-src/landingpage.ts',
7+
entry: {
8+
landingpage: './docs-src/landingpage.ts',
9+
premium: './docs-src/premium.ts'
10+
},
811
module: {
912
rules: [
1013
{
@@ -68,7 +71,7 @@ module.exports = {
6871
extensions: ['.tsx', '.ts', '.js'],
6972
},
7073
output: {
71-
filename: 'landingpage.js',
74+
filename: '[name].js',
7275
path: path.resolve(__dirname, '../', 'docs')
7376
},
7477
devServer: {

docs-src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155

156156
* [Transactions, Conflicts and Revisions](./transactions-conflicts-revisions.md)
157157

158-
* [RxDB Premium](./premium.md)
158+
* [RxDB Premium](./premium.html)
159159

160160

161161
* Tutorials

docs-src/database.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
getRxStorageDexie
3+
} from '../plugins/dexie';
4+
import {
5+
createRxDatabase,
6+
addRxPlugin
7+
} from '../';
8+
import {
9+
RxDBLocalDocumentsPlugin
10+
} from '../plugins/local-documents';
11+
12+
export async function getDatabase() {
13+
addRxPlugin(RxDBLocalDocumentsPlugin);
14+
15+
const database = await createRxDatabase({
16+
name: 'rxdb-landingpage',
17+
localDocuments: true,
18+
storage: getRxStorageDexie()
19+
});
20+
21+
return database;
22+
}

docs-src/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
<meta
2323
property="og:title"
2424
content="RxDB - A client side, offline-first, reactive database for JavaScript Applications"
25-
>
25+
/>
2626
<meta
2727
property="og:image"
2828
content="https://rxdb.info/files/logo/logo_text.png"
2929
/>
3030
<meta
3131
name="twitter:site"
3232
content="@rxdbjs"
33-
>
33+
/>
3434
<meta
3535
name="twitter:image:src"
3636
content="https://rxdb.info/files/logo/logo_text.png"
37-
>
37+
/>
3838
<meta
3939
name="thumbnail"
4040
content="https://rxdb.info/files/logo/icon.png"
@@ -43,7 +43,7 @@
4343
<meta
4444
name="viewport"
4545
content="width=device-width,initial-scale=1.0"
46-
>
46+
/>
4747
<link
4848
rel="stylesheet"
4949
href="styles/variables.css"
@@ -116,6 +116,7 @@
116116
</div>
117117
</div>
118118
</a>
119+
<div class="clear"></div>
119120
</div>
120121
<div class="clear"></div>
121122
</header>

docs-src/landingpage.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
import {
22
ensureNotFalsy,
3-
createRxDatabase,
43
RxLocalDocument,
54
now,
6-
addRxPlugin,
75
promiseWait
86
} from '../';
9-
import {
10-
getRxStorageDexie
11-
} from '../plugins/dexie';
12-
import {
13-
RxDBLocalDocumentsPlugin
14-
} from '../plugins/local-documents';
15-
addRxPlugin(RxDBLocalDocumentsPlugin);
16-
import {
17-
RxDBLeaderElectionPlugin
18-
} from '../plugins/leader-election';
19-
addRxPlugin(RxDBLeaderElectionPlugin);
207
import {
218
merge,
229
fromEvent,
2310
map,
2411
distinctUntilChanged
2512
} from 'rxjs';
13+
import { getDatabase } from './database';
2614

2715

2816
type MousePositionType = {
@@ -38,6 +26,8 @@ type BeatingValuesType = {
3826
color: string;
3927
};
4028

29+
const dbPromise = getDatabase();
30+
4131

4232
window.onload = async function () {
4333

@@ -59,11 +49,7 @@ window.onload = async function () {
5949
}
6050

6151

62-
const database = await createRxDatabase({
63-
name: 'rxdb-landingpage',
64-
localDocuments: true,
65-
storage: getRxStorageDexie()
66-
});
52+
const database = await dbPromise;
6753

6854

6955
// once insert if not exists

0 commit comments

Comments
 (0)