rounds

0.1.1 • Public • Published

Rounds

This is a standalone gun chain plugin that converts gun's .map() function into an array, for use in riot packages.

npm install riot gun rounds

In your app initialization:

var Gun = require('gun')
Gun.chain.convert = require('rounds');

And then inside your riot tag, expecting gun passed as an opt object:

tag
  ul
    li(each='{ item in items }') { item }
  script.
    this.on('mount', init)

    function init() {
      opts.gun.get('path/to/data').convert(this.items)
    }

The variable this.items will now stay in sync with gun's data when created or edited via gun.set({ /* ... */ }).

Todo

  • testing
  • link to example within project

Readme

Keywords

none

Package Sidebar

Install

npm i rounds

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • fussy