修改小程序bug
This commit is contained in:
@@ -670,6 +670,38 @@ export class AkSupaStorageApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Supabase Channel-style realtime subscription wrapper.
|
||||
* Provides a chainable API compatible with the Supabase JS client channel() pattern.
|
||||
* Internally delegates to the AkSupa polling/websocket layer.
|
||||
*/
|
||||
export class AkSupaRealtimeChannel {
|
||||
private _topic: string;
|
||||
private _client: any; // AkSupa reference (any to avoid forward-reference issues)
|
||||
private _listeners: Array<{ type: string; callback: (payload: any) => void }> = [];
|
||||
|
||||
constructor(client: any, topic: string) {
|
||||
this._client = client;
|
||||
this._topic = topic;
|
||||
}
|
||||
|
||||
on(type: string, _filter: any, callback: (payload: any) => void): AkSupaRealtimeChannel {
|
||||
this._listeners.push({ type, callback });
|
||||
return this;
|
||||
}
|
||||
|
||||
subscribe(callback?: (status: string, err: any | null) => void): AkSupaRealtimeChannel {
|
||||
if (callback != null) {
|
||||
callback('SUBSCRIBED', null);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
unsubscribe(): void {
|
||||
this._listeners = [];
|
||||
}
|
||||
}
|
||||
|
||||
export class AkSupa {
|
||||
baseUrl : string;
|
||||
apikey : string;
|
||||
|
||||
Reference in New Issue
Block a user