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

https://github.com/cheft/riot-spa-template

a riot spa template
https://github.com/cheft/riot-spa-template

Last synced: 11 months ago
JSON representation

a riot spa template

Awesome Lists containing this project

README

          

![Alt text](snapshot/demo.png)

# cheftjs
是基于 riot.js 薄封装的一套类 flux 框架

||=====================||
|| Application ||
||=====================||
|| Router ||
||=====================||
Tag --> do --> on
\ | /
\ Store /
\______________/
<--

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

## Router - [like backbone](http://backbonejs.org/#Router-routes)
module.exports = {
routes: {
'': 'home'
},
home: function() {

}
}

## Tag - [base on riot](https://github.com/riot/riot)


{result}


test

## do

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

## Store

module.exports = {
store: ''
}

or

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

### method
* get()
* save()
* del()
* post()
* put()

## on

module.exports = {
on: {
init: function() {}
mount: function() {}
update: function() {}
updated: function() {}
geted : function(data, status) {}
posted : function(data, status) {}
puted : 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

![Alt text](snapshot/demo.png)

## [Project](https://github.com/cheft/extend-frontend)
![Alt text](snapshot/1.jpg)