Skip to content

Example with multiple parameters? #4

Answered by daltonmenezes
theogravity asked this question in Q&A
Discussion options

You must be logged in to vote

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()  }
    },
  },
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by theogravity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants