Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrepolischuk/dact-electron
Sync dact between electron processes
https://github.com/andrepolischuk/dact-electron
dact electron sync
Last synced: 11 days ago
JSON representation
Sync dact between electron processes
- Host: GitHub
- URL: https://github.com/andrepolischuk/dact-electron
- Owner: andrepolischuk
- License: mit
- Created: 2017-05-10T14:28:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-10T14:32:34.000Z (over 7 years ago)
- Last Synced: 2024-10-05T10:05:23.991Z (about 2 months ago)
- Topics: dact, electron, sync
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dact-electron [![Build Status][travis-image]][travis-url]
> Sync [dact](https://github.com/andrepolischuk/dact) between [electron](https://github.com/electron/electron) processes
## Install
```sh
npm install --save dact-electron
```## Usage
In renderer process:
```js
const createData = require('dact')
const sync = require('dact-electron')
const {ipcRenderer} = require('electron')const initial = {
users: []
}const data = createData(initial, sync(ipcRenderer))
```In main process:
```js
const createData = require('dact')
const sync = require('dact-electron')
const {app, ipcMain, BrowserWindow} = require('electron')const initial = {
users: []
}app.on('ready', () => {
const win = new BrowserWindow()
const data = createData(initial, sync(ipcMain, win))win.loadURL(`file://${__dirname}/index.html`)
})
```## License
MIT
[travis-url]: https://travis-ci.org/andrepolischuk/dact-electron
[travis-image]: https://travis-ci.org/andrepolischuk/dact-electron.svg?branch=master