fix: allow LiveQuery on Parse.Session (#7554)

This commit is contained in:
dblythy
2021-10-09 02:24:33 +11:00
committed by GitHub
parent 484c2e81ca
commit caee281bc5
7 changed files with 120 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
import { ParseCloudCodePublisher } from '../LiveQuery/ParseCloudCodePublisher';
import { LiveQueryOptions } from '../Options';
import { getClassName } from './../triggers';
export class LiveQueryController {
classNames: any;
liveQueryPublisher: any;
@@ -9,7 +10,10 @@ export class LiveQueryController {
if (!config || !config.classNames) {
this.classNames = new Set();
} else if (config.classNames instanceof Array) {
const classNames = config.classNames.map(name => new RegExp('^' + name + '$'));
const classNames = config.classNames.map(name => {
const _name = getClassName(name);
return new RegExp(`^${_name}$`);
});
this.classNames = new Set(classNames);
} else {
throw 'liveQuery.classes should be an array of string';