Skip to content

Instantly share code, notes, and snippets.

View KristofferTolboll2's full-sized avatar

Kristoffer Tølbøll KristofferTolboll2

View GitHub Profile
//BAD PRACTISE
const { someValue, setSomeValue, isUpdateValue, } = useContext()
const myCoolFunction = () => {
const data = getData()
//Do other stuff
import { v4 as uuid } from 'uuid'
const heightData = [...]
//Discouraged
const heightDataComponent = heightData.map((heightData, index) => {
return <SomeElement key={index}
const getHeightData = () =>{
let heightData=
for (i = 0...
return
}
//The other way
IsOnline for proiles.
- From `Header.tsx` -> `Profile.tsx` set is online functionality.
- `isOnline` on NewUserCard.tsx
- Rename NewUserCard.tsx to
- NewUserCard.tsx -> ExploreUserCard.tsx
- DetailedUserCard.tsx -> InsepectUserCard.tsx
- Sandra PR merge
- Checkout Instagram service error, and possibility to connect
- Notification service
//New change
style={[
styles.chip,
{
backgroundColor: selected ? colors.violet4 : colors.mainbackground,
padding: 2,
borderWidth: 1,
borderColor: selected ? colors.violet4 : noBorder,
export interface SignUpNewPayload {
email: string
password: string
hasAcceptedTerms: boolean
hasAcceptedMarketing: boolean
}
//HTTP payload
const data: SignUpNewPayload = {
email: email.value,
export const MAX_AMOUNT_USER_IMAGE = 6
export const ImagePlaceholder = () => {
return <View>...</View>
}
async handleDisconnect(client: Socket) {
this.logger.debug(`${client.id} is disconnected...`)
//Handle end acitivty session
await this.authService.removeSocket(client.id)
}
async handleConnection(client: Socket) {
this.logger.debug(`${client.id} is connected...`)
// eslint-disable-next-line @typescript-eslint/tslint/config
const token = client.handshake.query?.token
// eslint-disable-next-line @typescript-eslint/tslint/config
const deviceType: string = client.handshake.query?.deviceType || 'WEB'
const ipAddress: string = client.handshake.address || null
if (!token) {
import { IsIP } from 'class-validator'
import { BaseEntity } from 'src/utilities/models/base.entity'
import { Column, Entity, ManyToOne } from 'typeorm'
import { User } from '../user.entity'
export enum DeviceType {
IOS = 'IOS',
ANDROID = 'ANDROID',
//Can add web and more later on
}