Skip to content

Interaction

ikcede edited this page Mar 19, 2024 · 1 revision

Class: Interaction

Wrapper class for interactions (likes, matches)

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Interaction(matchDate, removeDate, like, chats, weMet): Interaction

Parameters

Name Type
matchDate null | Date
removeDate null | Date
like null | Like
chats Message[]
weMet null | WeMet

Returns

Interaction

Defined in

hinge-wrapper.ts:135

Properties

chats

chats: Message[]

Messages the user sent (does not include comment from Like)

Defined in

hinge-wrapper.ts:128


like

like: null | Like

Set if the user sent a like

Defined in

hinge-wrapper.ts:123


matchDate

matchDate: null | Date

The timestamp when either user matched

Defined in

hinge-wrapper.ts:113


removeDate

removeDate: null | Date

The timestamp when the user hit X or unmatched

Defined in

hinge-wrapper.ts:118


weMet

weMet: null | WeMet

An option the user marked using the We Met feature

Defined in

hinge-wrapper.ts:133

Methods

isDate

isDate(): boolean

Checks if the user notes that they met.

Returns

boolean

True if weMet is set with a flag of 'Yes'

Defined in

hinge-wrapper.ts:181


isMatch

isMatch(): boolean

Checks if the user matched with another user.

Returns

boolean

True if matchDate is set

Defined in

hinge-wrapper.ts:163


isRejection

isRejection(): boolean

Checks if the user hit the X or unmatched.

Returns

boolean

True if removeDate is set

Defined in

hinge-wrapper.ts:172


isSentLike

isSentLike(): boolean

Checks if this interaction started with a like sent by the user

Returns

boolean

True if the interaction includes a like

Defined in

hinge-wrapper.ts:154


fromRaw

fromRaw(data): Interaction

Builds an Interaction from raw object data in matches.json

Parameters

Name Type
data any

Returns

Interaction

A built Interaction object

Defined in

hinge-wrapper.ts:191