Refactoring 2
This commit is contained in:
parent
dd14dfe72e
commit
e4b78ceec2
76 changed files with 870 additions and 734 deletions
16
packages/bridge-ui/lib/utils.ts
Normal file
16
packages/bridge-ui/lib/utils.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { Service, ServiceParams } from "./service";
|
||||
import { Facebook } from "./facebook";
|
||||
import { Signal } from "./signal";
|
||||
import { Whatsapp } from "./whatsapp";
|
||||
|
||||
export const getService = ({ service }: ServiceParams): Service => {
|
||||
if (service === "facebook") {
|
||||
return new Facebook();
|
||||
} else if (service === "signal") {
|
||||
return new Signal();
|
||||
} else if (service === "whatsapp") {
|
||||
return new Whatsapp();
|
||||
}
|
||||
|
||||
throw new Error("Service not found");
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue