1
0
mirror of https://github.com/Lightcord/Lightcord.git synced 2025-04-12 00:55:40 +02:00
Jean Ouina b8af18aef6 click to show changes
tabs fix (I fixed network, open tab and other things)
travis prerelease
Getting rid of the remote module (partially). Still have a lot of work.
Updating native modules.
partially updating to match version 0.0.308. Still need more changes.
2020-09-12 14:52:50 +02:00

25 lines
650 B
JavaScript

const {Dispatch: DispatchNative} = require('./discord_dispatch_'+process.platform+'.node');
let lastState = null;
function dispatchConstructor(jsonConfigString, updateCallback, errorCallback, analyticsCallback) {
const instance = new DispatchNative(
jsonConfigString,
(state) => {
lastState = JSON.parse(state);
updateCallback(state);
},
errorCallback,
analyticsCallback
);
return {
command: instance.command.bind(instance),
destroy: (...args) => {
instance.destroy(...args);
lastState = null;
},
};
}
module.exports = {Dispatch: dispatchConstructor, getLastState: () => lastState};