rightful-hot

3.2.4 • Public • Published

App convention for RiotJS+ZappaJS

Starts riot with the conventions of ZappaJS-client, with the following mixins:

  • @wrapper to wrap riot events into a Promise
  • @throttle to throttle calls to a function
  • and additional riot events for socket.io errors.

Also provides two Riot tags:

  • rightful-hot/i18n
  • rightful-hot/language-selector

Typically started as

{main,Debug} = require 'rightful-hot'

config =
  messages: 'en-US': {...}

socketio_module =
  include: ->
    # executed in a ZappaJS-client context
    @on 'event-from-server', -> @ev.trigger 'event'
    @ev.on 'event-from-client', => @emit 'event-to-server'

main config, seem ->
  yield @include socketio_module
  @riot.mount '*', client:true

/rightful-hot/

    Package Sidebar

    Install

    npm i rightful-hot

    Weekly Downloads

    0

    Version

    3.2.4

    License

    Unlicense

    Last publish

    Collaborators

    • shimaore