# riot.hx

> haxe wrapper around riot.js

Latest version **0.0.5** (published 2016-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install riot.hx
pnpm add riot.hx
yarn add riot.hx
bun add riot.hx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2016-01-26 |
| First published | 2015-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | francescoagati |
| Maintainers | haxelib.js |
| Keywords | javascript, library, haxe |

## Links

- npm: https://www.npmjs.com/package/riot.hx
- Repository: https://github.com/francescoagati/riot.hx
- Issues: https://github.com/francescoagati/riot.hx/issues
- npm.io page: https://npm.io/package/riot.hx

## Recent versions

- 0.0.5 (latest) — 2016-01-26
- 0.0.4 — 2015-12-31
- 0.0.3 — 2015-09-18
- 0.0.2 — 2015-08-06

## README

# riot.hx

haxe wrapper around Riot.js

[![Join the chat at https://gitter.im/francescoagati/riot.hx](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/francescoagati/riot.hx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)



for install from git
```
haxelib git riot.hx https://github.com/francescoagati/riot.hx.git
```


in you code (see folder test for complete example)

haxe component
```
using riot.RiotTools;

@:tagName('counter')
@:templateFile('templates/counter/counter.html')
@:cssFile('templates/counter/counter.css')
@:autoMount
@:keep
class Component implements riot.IRiotComponent {
  public var view:Dynamic;


  @:bind function incr() {
    view.counter++;
  }

  @:bind function async_incr() {
    haxe.Timer.delay(function() {
      view.counter++;
      update();
    },2000);
  }

  function mount() {
    trace('component mounted on $root()');
    untyped console.log(root());
  }

  public function new(v,opts) {
    bind_view(v);
    view.counter = 0;
    view.on('mount',mount);
  }

}
```
your template riot
```
<button onclick={incr}>incr</button>
<button onclick={async_incr}>async incr</button>
<span class="counter">{counter}</span>
```

your template css injected during the definition of component
```
  .counter {
    background:red;
    color:yellow;
  }
```

in your html page
```
<html>
  <head>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/riot/2.0.15/riot.min.js"></script>

  </head>
  <body>
    <counter></counter>
    <script src="test.js"></script>
  </body>
</html>
```

example with haxe code compiled to javascript
http://jsfiddle.net/ohtfow3z/1/

---
_Source: https://npm.io/package/riot.hx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
