From 06e94488630897ef21f5d8066406ebcf459c76fb Mon Sep 17 00:00:00 2001 From: Umed Khudoiberdiev Date: Wed, 27 Jun 2018 23:42:00 +0500 Subject: [PATCH] added example how to use data in the second process as well --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 9e27ee0..6140010 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +import {createConnection} from "typeorm"; + var electron = require("electron"); var url = require("url"); @@ -9,4 +11,11 @@ electron.app.on("ready", () => { slashes: true })); mainWindow.toggleDevTools(); + setTimeout(() => { + console.log("You can also get posts from the second process:"); + createConnection().then(async connection => { + const posts = await connection.getRepository("Post").find(); + console.log("posts:", posts); + }); + }, 5000); }); \ No newline at end of file