Skip to content

Commit

Permalink
Merge pull request #2511 from theengineear/create-core-state
Browse files Browse the repository at this point in the history
Create Core State
  • Loading branch information
rgbkrk committed Feb 9, 2018
2 parents 5fb299e + 7ccda29 commit 1a3930d
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions packages/types/core/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,19 @@ and `cellOrder` (list of cell ids). We're taking it to the next level here.
opaque type Id = string;
opaque type Ref = string;
type state = {
// The top level of core state can be considered a entry (which can be a
// "notebook", "directory", or plain "file").
app: {
// On desktop we'll have the one built-in local host that connects to
// zeromq directly. On jupyterhub backed apps, you'll be able to switch to
// different hosts.
selectedHostRef: Ref,
hostRefs: Array<Ref>,
selectedContentRef: Ref
},
preferences: {
lastSaved: Date
},
type core = {
// On desktop we'll have the one built-in local host that connects to
// zeromq directly. On jupyterhub backed apps, you'll be able to switch to
// different hosts.
selectedHostRef: Ref,
hostRefs: Array<Ref>,
selectedContentRef: Ref
// The piece of state that allows the ui to show loading/error indicators.
// This is split apart from the entities definitions because the two parts of
// state serve very different purposes.
communication: {
notebook: {
isSaving: boolean,
error: ?Object
},
preferences: {
isSaving: boolean,
error: ?Object
Expand Down Expand Up @@ -109,22 +98,25 @@ type state = {
error: ?Object
}
}
}
},
contents: {
byRef: {
[ref: Ref]: {
loading: boolean,
error: ?Object
},
contents: {
byRef: {
[ref: Ref]: {
loading: boolean,
error: ?Object
}
}
}
}
},
// These are the actual data that we get back from
// * API Calls
// * User input
// * Kernel output
entities: {
preferences: {
lastSaved: Date
},
outputs: {
byRef: {
[ref: Ref]: {
Expand Down Expand Up @@ -174,6 +166,7 @@ type state = {
[ref: Ref]: {
name: string,
resources: Object,
hostRef: Ref,
spec: {
displayName: string,
language: string,
Expand All @@ -189,8 +182,7 @@ type state = {
[ref: Ref]: {
id: string,
type: ("local" | "jupyter"),
selectedKernelRef: Ref,
kernelRefs: Array<Ref>,
kernelIds: Array<Id>,
kernelspecsRef: Ref,
defaultKernelName: string,
token: string,
Expand Down

0 comments on commit 1a3930d

Please sign in to comment.