Flux 模式实现 DeLorean
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: http://deloreanjs.com/
- 软件文档: https://github.com/deloreanjs/delorean
软件介绍
DeLoreanjs(Delorean.js) 是极小的 Flux 模式实现:
单向数据流,是的你的应用逻辑比 MVC 还简单
自动监听数据变化情况,保持数据持续更新
这是个很完整的框架,没有视图框架
非常小,压缩后只有 4K
内置 React.js 集成,易于使用 Flight.js 和 Reactive.js 或者其他的 JS 库
使用回滚提高 UI 和数据的一致性
示例:
/* * Stores are simple data buckets which manages data. */var Store = Flux.createStore({
data: null,
setData: function (data) {
this.data = data;
this.emit('change');
},
actions: {
'incoming-data': 'setData'
}});var store = new Store();/* * Dispatchers are simple action dispatchers for stores. * Stores handle the related action. */var Dispatcher = Flux.createDispatcher({
setData: function (data) {
this.dispatch('incoming-data', data);
},
getStores: function () {
return {increment: store};
}});/* * Action Creators are simple controllers. They are simple functions. * They talk to dispatchers. They are not required. */var Actions = {
setData: function (data) {
Dispatcher.setData(data);
}};// The data cycle.store.onChange(function () {
// End of data cycle.
document.getElementById('result').innerText = store.store.data;});document.getElementById('dataChanger').onclick = function () {
// Start data cycle:
Actions.setData(Math.random());};
Scratch少儿趣味编程
[ 日] 阿部和广 / 陶 旭 / 人民邮电出版社 / 2014-11 / 59.00元
Scratch 是麻省理工学院设计开发的一款编程工具,是适合少儿学习编程和交流的工具和平台,有中文版且完全免费。本书结合孩子们学习的语文、数学、科学、社会、音乐、体育等科目,手把手地教大家如何用Scratch 设计程序(如设计一个自动写作文的程序),配合各式卡通形象,通俗易懂,寓教于乐。麻省理工学院教授米切尔•瑞斯尼克作序推荐。 本书图文并茂,生动风趣,适合中小学生等初学者自学或在家长的帮助......一起来看看 《Scratch少儿趣味编程》 这本书的介绍吧!
