Skip to content

Commit

Permalink
Expose execution_state in the JS package
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Aug 7, 2024
1 parent 16162f9 commit 8f75a27
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions javascript/src/ycell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,20 @@ export class YCodeCell
}
}

/**
* The code cell's execution state.
*/
get execution_state(): 'running' | 'idle' {
return this.ymodel.get('execution_state') ?? 'idle';
}
set execution_state(state: 'running' | 'idle') {
if (this.ymodel.get('execution_state') !== state) {
this.transact(() => {
this.ymodel.set('execution_state', state);
}, false);
}
}

/**
* Cell outputs.
*/
Expand Down

0 comments on commit 8f75a27

Please sign in to comment.