Add electron

This commit is contained in:
Thomas Nordquist
2019-01-01 15:31:33 +01:00
parent 4e09ea3d30
commit b2badfd43f
37 changed files with 3900 additions and 2578 deletions

View File

@@ -0,0 +1,41 @@
interface InternalState {
connecting: boolean
connected: boolean
error?: Error
}
export class DataSourceState {
private state: InternalState = {
error: undefined,
connected: false,
connecting: false
}
public setConnected(connected: boolean) {
this.state = {
error: undefined,
connected: connected,
connecting: false
}
}
public setError(error: Error) {
this.state = {
error: error,
connected: false,
connecting: false
}
}
public setConnecting() {
this.state = {
error: undefined,
connected: false,
connecting: true
}
}
public toJSON() {
return this.state
}
}