Skip to content

cyyjs/electron-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

electron-router

LICENSE npm (scoped)

Communicate asynchronously from the main process to renderer processes it's that simple!

Install

yarn add @cyyjs/electron-router

Usage

Main

const router = require('@cyyjs/electron-router')

router.get('list', async (query) => {
  return {
    err: '',
    data: {
      a: 1
    }
  }
})

router.post('save', async(data) => {})
router.put('update', async(data) => {})
router.delete('remove', async(id) => {})

Render

const api = require('@cyyjs/electron-router')

let { err, data } = await api.get('list', query)
// data: { a: 1 }

await api.post('save', {})
await api.put('update', {})
await api.delete('remove', id)

About

electron-router

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published