Example with multiple parameters? #4
Answered
by
daltonmenezes
theogravity
asked this question in
Q&A
-
If I want to define multiple parameters, what's the appropriate way to do it? It seems the |
Beta Was this translation helpful? Give feedback.
Answered by
daltonmenezes
Feb 13, 2023
Replies: 1 comment
-
Hi @theogravity , you can pass an object like this: import { createIpcSlice } from 'interprocess'
interface Message {
id: string
message: string
}
export const rendererIpcSlice = createIpcSlice({
renderer: {
async myAnotherIpcHandler(_, { id, message }: Message) {
console.log({ id, message })
// do something with the data when this handler is invoked by the main process
return { message: message.toLowerCase() }
},
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
theogravity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @theogravity , you can pass an object like this: