0.1.1 • Published 9 years ago

riotflux v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

riotflux

修改于 cheftjs的 flux 框架

Application

var c = require('riotflux');
var app = new c.Applicaton({
    router: require('./router.js')
});    

Router - like backbone

module.exports = {
    routes: {
        '': 'home'
    },
    home: function() {

    }
}

Tag - base on riot

<test>
    <script></script>
    <h1>{result}</h1>
    <button onclick={clickMe}>test</button>
</test>

Actions

module.exports = {
    actions: {
        clickMe: function() {
            this.result = 'click success!';
            this.trigger('clicked');
        }
    }
}

Store

module.exports = {
    store: ''
}

or

module.exports = {
    store: {
        url: '',
        contentType: ''
    }
}

method

  • get()
  • save()
  • del()
  • post()

Listeners

module.exports = {
    listeners: {
        init:    function() {}
        mount:   function() {}
        update:  function() {}
        updated: function() {}
        geted  : function(data, status) {}
        posted : function(data, status) {}
        saved  : function(data, status) {}
        deleted: function(data, status) {}
        
        clicked : function() {
            console.log('the tag can auto update');
        }
    }
}

Demo

cd demo
npm install
gulp
0.1.1

9 years ago

0.1.0

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago