An open API service indexing awesome lists of open source software.

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: 2 months ago
JSON representation

Polymer Web Component for sharing data with Yjs

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).