Skip to content

Commit

Permalink
Feature/new premium (pubkey#4156)
Browse files Browse the repository at this point in the history
* ADD stuff

* CHORE

* CHORE

* FIX more stuff

* FIX lint

* FIX link
  • Loading branch information
pubkey authored Nov 28, 2022
1 parent 4847dea commit c3db9d7
Show file tree
Hide file tree
Showing 10 changed files with 1,354 additions and 133 deletions.
7 changes: 5 additions & 2 deletions config/landingpage.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
entry: './docs-src/landingpage.ts',
entry: {
landingpage: './docs-src/landingpage.ts',
premium: './docs-src/premium.ts'
},
module: {
rules: [
{
Expand Down Expand Up @@ -68,7 +71,7 @@ module.exports = {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'landingpage.js',
filename: '[name].js',
path: path.resolve(__dirname, '../', 'docs')
},
devServer: {
Expand Down
2 changes: 1 addition & 1 deletion docs-src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

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

* [RxDB Premium](./premium.md)
* [RxDB Premium](./premium.html)


* Tutorials
Expand Down
22 changes: 22 additions & 0 deletions docs-src/database.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
getRxStorageDexie
} from '../plugins/dexie';
import {
createRxDatabase,
addRxPlugin
} from '../';
import {
RxDBLocalDocumentsPlugin
} from '../plugins/local-documents';

export async function getDatabase() {
addRxPlugin(RxDBLocalDocumentsPlugin);

const database = await createRxDatabase({
name: 'rxdb-landingpage',
localDocuments: true,
storage: getRxStorageDexie()
});

return database;
}
9 changes: 5 additions & 4 deletions docs-src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
<meta
property="og:title"
content="RxDB - A client side, offline-first, reactive database for JavaScript Applications"
>
/>
<meta
property="og:image"
content="https://rxdb.info/files/logo/logo_text.png"
/>
<meta
name="twitter:site"
content="@rxdbjs"
>
/>
<meta
name="twitter:image:src"
content="https://rxdb.info/files/logo/logo_text.png"
>
/>
<meta
name="thumbnail"
content="https://rxdb.info/files/logo/icon.png"
Expand All @@ -43,7 +43,7 @@
<meta
name="viewport"
content="width=device-width,initial-scale=1.0"
>
/>
<link
rel="stylesheet"
href="styles/variables.css"
Expand Down Expand Up @@ -116,6 +116,7 @@
</div>
</div>
</a>
<div class="clear"></div>
</div>
<div class="clear"></div>
</header>
Expand Down
22 changes: 4 additions & 18 deletions docs-src/landingpage.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
import {
ensureNotFalsy,
createRxDatabase,
RxLocalDocument,
now,
addRxPlugin,
promiseWait
} from '../';
import {
getRxStorageDexie
} from '../plugins/dexie';
import {
RxDBLocalDocumentsPlugin
} from '../plugins/local-documents';
addRxPlugin(RxDBLocalDocumentsPlugin);
import {
RxDBLeaderElectionPlugin
} from '../plugins/leader-election';
addRxPlugin(RxDBLeaderElectionPlugin);
import {
merge,
fromEvent,
map,
distinctUntilChanged
} from 'rxjs';
import { getDatabase } from './database';


type MousePositionType = {
Expand All @@ -38,6 +26,8 @@ type BeatingValuesType = {
color: string;
};

const dbPromise = getDatabase();


window.onload = async function () {

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


const database = await createRxDatabase({
name: 'rxdb-landingpage',
localDocuments: true,
storage: getRxStorageDexie()
});
const database = await dbPromise;


// once insert if not exists
Expand Down
Loading

0 comments on commit c3db9d7

Please sign in to comment.