Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
fetchLaunches(after) {
return self.query(GET_LAUNCHES, after ? { after } : undefined)
},
clearCart() {
self.cartItems.splice(0)
},
bookTrips() {
return self.mutate(
BOOK_TRIPS,
{ launchIds: getSnapshot(self.cartItems) },
self.clearCart // optimistically clear the cart
)
}
}))
.extend(localStorageMixin())
messages: types.optional(types.map(types.late(() => Message)), {})
})
.actions(self => ({
queryMessages(variables?: { }, resultSelector = messagePrimitives, options: QueryOptions = {}) {
return self.query(`query messages { messages {
${resultSelector}
} }`, variables, options)
},
subscribeNewMessages(variables?: { }, resultSelector = messagePrimitives) {
return self.subscribe(`subscription newMessages { newMessages {
${resultSelector}
} }`, variables)
},
}))
/* #endregion */
.extend(localStorageMixin())