Skip to content

Commit 17f331b

Browse files
Deprecate Interaction API, to be replaced by Actions API (#18)
1 parent a59de06 commit 17f331b

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ interface PluginInstance<T> {
479479
): Unsubscriber;
480480
481481
/**
482+
* @deprecated Use Action API instead
482483
* Allows users to subscribe to changes in the passed in interaction ID
483484
*/
484485
subscribeToWorkbookInteraction(

src/client/initialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export function initialize<T = {}>(): PluginInstance<T> {
210210
},
211211
fetchMoreElementData(id) {
212212
void execPromise('wb:plugin:element:fetch-more', id);
213-
}
213+
},
214214
},
215215
destroy() {
216216
Object.keys(listeners).forEach(event => delete listeners[event]);

src/react/hooks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export function useVariable(
182182
}
183183

184184
/**
185+
* @deprecated Use Action API instead
185186
* React hook for accessing a workbook interaction selections state
186187
* @param {string} id ID of variable within Plugin Config to use
187188
* @returns {[(WorkbookSelection | undefined), Function]} Constantly updating selection state and setter thereof

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,14 @@ export interface PluginInstance<T = any> {
248248
setVariable(id: string, ...values: unknown[]): void;
249249

250250
/**
251+
* @deprecated Use Action API instead
251252
* Getter for interaction selection state
252253
* @param {string} id ID from interaction type in Plugin Config
253254
*/
254255
getInteraction(id: string): WorkbookSelection[];
255256

256257
/**
258+
* @deprecated Use Action API instead
257259
* Setter for interaction selection state
258260
* @param {string} id ID from interaction type in Plugin Config
259261
* @param {string} elementId Source element ID from element type in Plugin Config
@@ -297,6 +299,7 @@ export interface PluginInstance<T = any> {
297299
): Unsubscriber;
298300

299301
/**
302+
* @deprecated Use Action API instead
300303
* Allows users to subscribe to changes in the passed in interaction ID
301304
* @param {string} id ID of the interaction variable within Plugin Config
302305
* @callback callback Function to be called upon receiving an updated interaction selection state

0 commit comments

Comments
 (0)