Skip to content

Commit

Permalink
added example how to use data in the second process as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Umed Khudoiberdiev committed Jun 27, 2018
1 parent 1e0f49c commit 06e9448
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {createConnection} from "typeorm";

var electron = require("electron");
var url = require("url");

Expand All @@ -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);
});

0 comments on commit 06e9448

Please # to comment.