Skip to content

Commit f20085b

Browse files
committed
better method name
1 parent 2c34bde commit f20085b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/client/initialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export function initialize<T = {}>(): PluginInstance<T> {
225225
},
226226

227227
style: {
228-
subscribeToStyle(callback: (style: any) => void) {
228+
subscribe(callback: (style: any) => void) {
229229
on('wb:plugin:style:update', callback);
230230
return () => off('wb:plugin:style:update', callback);
231231
},

src/react/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export function usePluginStyle(): PluginStyle | undefined {
259259
useEffect(() => {
260260
// Request initial style data on mount and subscribe to updates
261261
void client.style.getStyle().then(response => setStyle(response));
262-
return client.style.subscribeToStyle(setStyle);
262+
return client.style.subscribe(setStyle);
263263
}, [client]);
264264

265265
return style;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export interface PluginInstance<T = any> {
363363
* @param callback Function to call when style updates
364364
* @returns Unsubscriber function
365365
*/
366-
subscribeToStyle(callback: (style: PluginStyle) => void): () => void;
366+
subscribe(callback: (style: PluginStyle) => void): () => void;
367367

368368
/**
369369
* Request current style from workbook

0 commit comments

Comments
 (0)