Skip to content

Instantly share code, notes, and snippets.

let contactsLocalDatabase = new ContactLocalDatabase("Contact table");
await contactsLocalDatabase.get(21);
const contactModel: ContactTable = {
id: 12,
name: 'Some name',
..., // define all other values.
...
}
interface ContactTable {
name: String;
}
interface ContactModel {
id: String;
name: String;
phoneNumber: String;
profilePicture: String;
createdAt: Date;
interface DatabaseConnector {
get: Function;
put: Function;
}
abstract class BaseLocalDatabase<T, M> {
tableName: String;
databaseInstance: DatabaseConnector;
export interface Person {
name: String;
}
export const convertToValueArray = <T>(value: T): Array<T> => {
return [value];
};
const person: Person = {
name: "Mahesh"
interface Person {
name: String
}
export const convertToValueArray = (value: any): Array<any> => {
return [value];
}
console.log(convertToValueArray(12)); // [12]
console.log(convertToValueArray("STRING")); // ["STRING"}
interface Person {
name: String
}
const convertStringToArray = (value: String): Array<String> => {
return [value];
}
const convertNumberToArray = (value: Number): Array<Number> => {
import React from "react";
import { useForm } from "react-hook-form";
function onSubmitForm(formData) {
console.log("The status of formData", formData);
alert("Hi your phone number is: " + formData.phoneNumber);
}
export default function MyForm() {
const { register, handleSubmit, errors, watch } = useForm();
import React from "react";
import { useForm } from "react-hook-form";
function onSubmitForm(formData) {
console.log("The status of formData", formData);
alert("Hi your phone number is: " + formData.phoneNumber);
}
export default function MyForm() {
const { register, handleSubmit, errors, watch } = useForm();
import React from "react";
import { useForm } from "react-hook-form";
function onSubmitForm(formData) {
console.log("The status of formData", formData);
alert("Hi your phone number is: " + formData.phoneNumber);
}
export default function MyForm() {
const { register, handleSubmit, errors } = useForm();
import React from "react";
import { useForm } from "react-hook-form";
function onSubmitForm(formData) {
console.log("The status of formData", formData);
alert("Hi your phone number is: " + formData.phoneNumber);
}
export default function MyForm() {
const { register, handleSubmit, errors } = useForm();