react-native-chating-ui-kit
Version:
CometChat React Native UI Kit is a collection of custom UI Components designed to build text , chat and calling features in your application. The UI Kit is developed to keep developers in mind and aims to reduce development efforts significantly
23 lines • 831 B
JavaScript
import { MessageDataSource } from "./MessageDataSource";
export class ChatConfigurator {
static dataSource = new MessageDataSource();
static names = ["message_utils"];
static init(initialSource) {
this.dataSource = initialSource ?? new MessageDataSource();
this.names = ["message_utils"];
this.names.push(this.dataSource.getId());
}
static enable(fun) {
let oldSource = this.dataSource;
let newSource = fun(oldSource);
if (!this.names.find(nm => nm == newSource.getId())) {
console.log("added", newSource.getId());
this.dataSource = newSource;
this.names.push(this.dataSource.getId());
}
}
static getDataSource() {
return ChatConfigurator.dataSource;
}
}
//# sourceMappingURL=ChatConfigurator.js.map