Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

first pass at unifying communication #27

Merged
merged 39 commits into from
Jun 23, 2016
Merged

first pass at unifying communication #27

merged 39 commits into from
Jun 23, 2016

Conversation

chriddyp
Copy link
Member

@chriddyp chriddyp commented Jun 9, 2016

No description provided.

@alexandresobolevski
Copy link
Contributor

alexandresobolevski commented Jun 13, 2016

establish credentials with the app, check connection with a POST to localhost:5000/connect

get table previews from testdb database using a POST to localhost:5000/tables

disconnect using a POST to localhost:5000/disconnect

ready @chriddyp 😄

@alexandresobolevski alexandresobolevski mentioned this pull request Jun 13, 2016
@alexandresobolevski
Copy link
Contributor

ipcMessageHandler.js, serverMessageHandler.js, ipc.js are now simplified into one file messageHandler.js

The latter receives commands from either the app through the IPC or from a remote server through a POST to localhost:5000.

Within messageHandler.js the callback function will be decided depending on the origin of the request (server vs app). The next steps are decided by either the TASK given by through the ipc channel or the /route at which the POST was received at for the app requests and remote server requests respectively.

sequelizeManager manages only what type of data is part of the response using the callback function given to it by messageHandler.js.

Object.keys(config).forEach( key => {
setup[key] = config[key];
});
return setup;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this just be written as:

const setup = R.merge(options, config);

?

@@ -43,7 +56,17 @@ app.on('ready', () => {
mainWindow.focus();
ipcMain.removeAllListeners(channel);
ipcMain.on(channel, ipcMessageHandler(sequelizeManager));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@chriddyp
Copy link
Member Author

looks great! this is coming out super clean 🛁 :)

just a couple things around:

  • some variable name changing
  • some un-promisifying synchornous code

💃 when those things are updated, or feel free to ping me for another review.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants