RecksJS基于React和RxJS的响应式框架

基于 RxJS 的响应式思维,加上 React 的组件机制,RecksJS搞出了个挺有意思的小框架,适合你想玩点儿不一样的场景。

RecksJS 的核心思路是:组件直接返回Observable,整个 UI 像数据流一样在动。比如用timer(0, 1000)每秒刷新一次,UI 就能自动跟着变化,完全不用useState那一套。

代码写起来也蛮直观的,像这样:

import Recks from 'recks';
import { timer } from 'rxjs';

function App() { const ticks$ = timer(0, 1000); return

{ticks$}

seconds passed

; }

是不是有点像黑科技?嗯,RecksJS 目前还在测试阶段,文档比较简洁,但上手难度不大,尤其你对 RxJS 已经比较熟的话。

你也可以看看它的“兄弟库”Juliette,也是基于 RxJS 做状态管理,用起来思路类似。

提醒一下:RecksJS 偏实验性,适合玩原型、Hack 项目或者做点炫酷小 Demo。如果你项目比较重,不太建议直接上。

如果你喜欢响应式编程,又觉得 React 太命令式,RecksJS 可以试试看,搞不好你会喜欢。

zip
recks-master.zip 预估大小:77个文件
folder
recks-master 文件夹
file
.lintstagedrc.json 141B
folder
configs 文件夹
file
webpack.dev.js 279B
file
webpack.base.js 867B
file
tsconfig.types.json 242B
file
tsconfig.esm.json 142B
file
tsconfig.cjs.json 172B
file
tsconfig.base.json 544B
file
tsconfig.es2015.json 173B
file
webpack.build.min.js 156B
file
webpack.build.js 157B
file
webpack.config.js 89B
file
.prettierignore 54B
folder
src 文件夹
file
constants.ts 58B
file
index.ts 2KB
folder
helpers 文件夹
file
isFunction.ts 84B
file
asObservable.ts 786B
file
destroyer.ts 387B
file
logPipe.ts 216B
file
isSubject.ts 168B
file
splitPropsToStreams.ts 3KB
file
isArray.ts 76B
file
isThenable.ts 137B
folder
engine 文件夹
folder
component 文件夹
file
Static.ts 2KB
file
index.ts 1KB
file
Observable.ts 1KB
folder
dynamic-entry 文件夹
file
ReplayDynamicEntry.ts 1KB
file
DynamicEntry.ts 3KB
file
DynamicEntry.test.ts 393B
file
Fn.ts 1KB
file
Leaf.ts 906B
file
Array.ts 6KB
file
helpers.ts 1KB
folder
render 文件夹
file
Static.ts 5KB
file
index.ts 2KB
file
Observable.ts 425B
file
Fn.ts 480B
file
Leaf.ts 675B
file
Array.ts 4KB
file
Element.ts 1KB
file
IChild.ts 202B
folder
dom 文件夹
file
UpdateDomChildNodesPipe.ts 14KB
file
DomElement.ts 2KB
file
.prettierrc.json 126B
folder
examples 文件夹
file
ParentChild.jsx 456B
file
List.jsx 193B
file
Timer.jsx 167B
file
TwoWayLike.jsx 341B
file
Basic.jsx 99B
file
Counter.jsx 396B
file
tsconfig.json 236B
file
LICENSE 1KB
file
jest.config.js 75B
file
README.md 4KB
file
.gitbook.yaml 75B
folder
docs 文件夹
folder
libraries 文件夹
file
state.md 98B
file
README.md 426B
folder
api 文件夹
file
dom-references.md 1KB
file
lifecycle.md 1KB
file
subcomponents.md 1KB
file
lists.md 388B
file
events.md 877B
file
install.md 1KB
file
.huskyrc.json 77B
file
.editorconfig 221B
folder
tests 文件夹
folder
jsdom 文件夹
file
Observable.test.tsx 4KB
file
Leaf.test.tsx 430B
file
Static.test.tsx 3KB
file
svg.test.tsx 1KB
folder
Fn 文件夹
file
index.test.tsx 1KB
file
props.test.tsx 5KB
file
children.test.tsx 2KB
file
Array.test.tsx 1KB
file
helpers.ts 665B
file
.gitignore 929B
file
package-lock.json 426KB
file
package.json 2KB
file
CHANGELOG 1KB
...
zip 文件大小:146.83KB