https://github.com/y-js/y-element
  
  
    Polymer Web Component for sharing data with Yjs 
    https://github.com/y-js/y-element
  
polymer yjs
        Last synced: 6 days ago 
        JSON representation
    
Polymer Web Component for sharing data with Yjs
- Host: GitHub
 - URL: https://github.com/y-js/y-element
 - Owner: y-js
 - License: other
 - Created: 2016-10-06T13:22:02.000Z (about 9 years ago)
 - Default Branch: master
 - Last Pushed: 2017-06-21T14:10:18.000Z (over 8 years ago)
 - Last Synced: 2025-06-12T17:16:18.371Z (5 months ago)
 - Topics: polymer, yjs
 - Language: HTML
 - Homepage: http://y-js.org/y-element/
 - Size: 5.31 MB
 - Stars: 9
 - Watchers: 4
 - Forks: 2
 - Open Issues: 2
 - 
            Metadata Files:
            
- Readme: README.md
 - License: LICENSE
 
 
Awesome Lists containing this project
README
          # \
> Polymer Web Component for sharing data with [Yjs](https://github.com/y-js/yjs/). Perform data-binding on shared data!
[Read the docs](http://y-js.org/y-element/) to get started!
This repository contains four elements:
* [y-element](//y-js.org/y-element/components/y-element/#y-element) - Configures the database and connector information
* [y-map](//y-js.org/y-element/components/y-element/#y-map) - Creates a map type. It exports the data as a shared javascript object
* [y-array](//y-js.org/y-element/components/y-element/#y-array) - Creates an array type. It exports the data as a shared javascript array
* [y-type](//y-js.org/y-element/components/y-element/#y-type) - Configuration for any Yjs type. It exports the Yjs type
##### Simple Yjs example in Javascript
```
Y({
  db: {
    name: 'memory'
  },
  connector: {
    name: 'websockets-client',
    room: 'example'
  },
  share: {
    map: 'Map'
  }
}).then(function (y) {
  y.share.map // is the shared map type
})
```
##### Same example in Polymer
```
  
```
### Before you start
Before you start remember to install all y-* modules you want to use.
In particular you need to install a connector (e.g. `y-websockets-client`), and
a database adapter (e.g. `y-memory`).
```
bower i --save y-element yjs y-map y-array y-memory y-websockets-client
```
<y-element>@>2.0.0 no longer supports automatic module finding. You need to explicitly include all y-* modules!
```html
```
## Contribute
Issues and Pull requests are very much welcome. If you want to help out you can also contribute to the docs ;) This project was build with [Polymer CLI](https://www.npmjs.com/package/polymer-cli) v0.16. Make sure the tests are still running ;)
## License
y-element is licensed under the [MIT License](./LICENSE).