Skip to content

Commit 17446d3

Browse files
authored
Fix loading state README and JSDOC (#38)
1 parent d8fdf06 commit 17446d3

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ interface PluginInstance<T> {
488488
registerEffect(configId: string, effect: Function): void;
489489
490490
/**
491-
* Overrider function for Config Ready state
491+
* Overrider function for Config loading state
492492
*/
493-
setLoadingState(ready: boolean): void;
493+
setLoadingState(isLoading: boolean): void;
494494
495495
/**
496496
* Allows users to subscribe to changes in the passed in variable
@@ -655,8 +655,8 @@ Arguments
655655
656656
#### useLoadingState()
657657
658-
Gets the current plugin's loading stat. Returns a value and a setter allowing
659-
you to update the plugin's loading state
658+
Gets the current plugin's loading state and a setter. Call the setter with
659+
`false` when your plugin has finished loading
660660
661661
```ts
662662
function useLoadingState(
@@ -666,7 +666,7 @@ function useLoadingState(
666666
667667
Arguments
668668
669-
- `initialState : boolean` - Initial value to set loading state to
669+
- `initialState : boolean` - Initial loading state (typically `true`; then set to `false` when ready)
670670
671671
#### useElementColumns()
672672

src/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,11 @@ export interface PluginInstance<T = any> {
303303
registerEffect(configId: string, effect: () => void): () => void;
304304

305305
/**
306-
* Overrider function for Config Ready state
307-
* @param {boolean} loadingState Boolean representing if Plugin Config is still loading
306+
* Tell the workbook whether the plugin is still loading. Pass false when the plugin
307+
* has finished loading and is ready to be used.
308+
* @param {boolean} isLoading Boolean representing if Plugin Config is still loading
308309
*/
309-
setLoadingState(ready: boolean): void;
310+
setLoadingState(isLoading: boolean): void;
310311

311312
/**
312313
* Allows users to subscribe to changes in the passed in variable

0 commit comments

Comments
 (0)