This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let contactsLocalDatabase = new ContactLocalDatabase("Contact table"); | |
await contactsLocalDatabase.get(21); | |
const contactModel: ContactTable = { | |
id: 12, | |
name: 'Some name', | |
..., // define all other values. | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ContactTable { | |
name: String; | |
} | |
interface ContactModel { | |
id: String; | |
name: String; | |
phoneNumber: String; | |
profilePicture: String; | |
createdAt: Date; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface DatabaseConnector { | |
get: Function; | |
put: Function; | |
} | |
abstract class BaseLocalDatabase<T, M> { | |
tableName: String; | |
databaseInstance: DatabaseConnector; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Person { | |
name: String; | |
} | |
export const convertToValueArray = <T>(value: T): Array<T> => { | |
return [value]; | |
}; | |
const person: Person = { | |
name: "Mahesh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Person { | |
name: String | |
} | |
export const convertToValueArray = (value: any): Array<any> => { | |
return [value]; | |
} | |
console.log(convertToValueArray(12)); // [12] | |
console.log(convertToValueArray("STRING")); // ["STRING"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Person { | |
name: String | |
} | |
const convertStringToArray = (value: String): Array<String> => { | |
return [value]; | |
} | |
const convertNumberToArray = (value: Number): Array<Number> => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
NewerOlder