[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3253":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":22,"defaultBranch":23,"hasWiki":21,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":28,"discoverSource":29},3253,"flux","facebookarchive\u002Fflux","facebookarchive","Application Architecture for Building User Interfaces","https:\u002F\u002Ffacebookarchive.github.io\u002Fflux\u002F",null,"JavaScript",17466,3389,17472,6,0,2,4,45,"Other",true,false,"main",[],"2026-06-12 02:00:47","## ⚠️ The Flux project has been archived and no further changes will be made. We recommend using more sophisticated alternatives like [Redux](http:\u002F\u002Fredux.js.org\u002F), [MobX](https:\u002F\u002Fmobx.js.org\u002F), [Recoil](https:\u002F\u002Frecoiljs.org\u002F), [Zustand](https:\u002F\u002Fgithub.com\u002Fpmndrs\u002Fzustand), or [Jotai](https:\u002F\u002Fgithub.com\u002Fpmndrs\u002Fjotai).\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ffacebookarchive\u002Fflux\u002Fblob\u002Fmain\u002Fwebsite\u002Fstatic\u002Fimg\u002Fflux-logo-color.svg\" alt=\"logo\" width=\"20%\" \u002F>\n\u003C\u002Fp>\n\u003Ch1 align=\"center\">\n  Flux\n\u003C\u002Fh1>\n\u003Cp align=\"center\">\n  An application architecture for React utilizing a unidirectional data flow.\u003Cbr>\n\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fflux\u002Fblob\u002Fmaster\u002FLICENSE\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-BSD%20-blue.svg\" alt=\"Licence Badge\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fflux\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fflux.svg?style=flat\" alt=\"Current npm package version.\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Chr\u002F>\n\n\u003Cimg src=\".\u002Fimg\u002Fflux-diagram-white-background.png\" style=\"width: 100%;\" \u002F>\n\n## Getting Started\n\nStart by looking through the [guides and examples](.\u002Fexamples) on Github. For more resources and API docs check out [facebook.github.io\u002Fflux](https:\u002F\u002Ffacebookarchive.github.io\u002Fflux).\n\n## How Flux works\n\nFor more information on how Flux works check out the [Flux Concepts](.\u002Fexamples\u002Fflux-concepts) guide, or the [In Depth Overview](https:\u002F\u002Ffacebookarchive.github.io\u002Fflux\u002Fdocs\u002Fin-depth-overview).\n\n## Requirements\n\nFlux is more of a pattern than a framework, and does not have any hard dependencies. However, we often use [EventEmitter](https:\u002F\u002Fnodejs.org\u002Fapi\u002Fevents.html#events_class_eventemitter) as a basis for `Stores` and [React](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact) for our `Views`. The one piece of Flux not readily available elsewhere is the `Dispatcher`. This module, along with some other utilities, is available here to complete your Flux toolbox.\n\n## Installing Flux\n\nFlux is available as a [npm module](https:\u002F\u002Fwww.npmjs.org\u002Fpackage\u002Fflux), so you can add it to your package.json file or run `npm install flux`. The dispatcher will be available as `Flux.Dispatcher` and can be required like this:\n\n```javascript\nconst Dispatcher = require('flux').Dispatcher;\n```\n\nTake a look at the [dispatcher API and some examples](https:\u002F\u002Ffacebookarchive.github.io\u002Fflux\u002Fdocs\u002Fdispatcher).\n\n## Flux Utils\n\nWe have also provided some basic utility classes to help get you started with Flux. These base classes are a solid foundation for a simple Flux application, but they are **not** a feature-complete framework that will handle all use cases. There are many other great Flux frameworks out there if these utilities do not fulfill your needs.\n\n```js\nimport {ReduceStore} from 'flux\u002Futils';\n\nclass CounterStore extends ReduceStore\u003Cnumber> {\n  getInitialState(): number {\n    return 0;\n  }\n\n  reduce(state: number, action: Object): number {\n    switch (action.type) {\n      case 'increment':\n        return state + 1;\n\n      case 'square':\n        return state * state;\n\n      default:\n        return state;\n    }\n  }\n}\n```\n\nCheck out the [examples](.\u002Fexamples) and [documentation](https:\u002F\u002Ffacebookarchive.github.io\u002Fflux\u002Fdocs\u002Fflux-utils) for more information.\n\n## Building Flux from a Cloned Repo\n\nClone the repo and navigate into the resulting `flux` directory. Then run `npm install`.\n\nThis will run [Gulp](https:\u002F\u002Fgulpjs.com\u002F)-based build tasks automatically and produce the file Flux.js, which you can then require as a module.\n\nYou could then require the Dispatcher like so:\n\n```javascript\nconst Dispatcher = require('path\u002Fto\u002Fthis\u002Fdirectory\u002FFlux').Dispatcher;\n```\n\nThe build process also produces de-sugared versions of the `Dispatcher` and `invariant` modules in a `lib` directory, and you can require those modules directly, copying them into whatever directory is most convenient for you. The `flux-todomvc` and `flux-chat` example applications both do this.\n\n## License\n\nFlux is BSD-licensed. We also provide an additional patent grant.\n","Flux是一个用于构建用户界面的应用架构，采用单向数据流模式。其核心功能包括Dispatcher、Store和View组件，通过这些组件实现数据的单向流动，确保应用状态的一致性和可预测性。技术上，Flux依赖于EventEmitter来管理Store，并推荐使用React作为View层。尽管该项目已归档不再更新，但其设计理念对于理解现代前端架构如Redux等仍有重要参考价值。适用于需要清晰分离关注点并保持复杂状态管理简单的Web应用开发场景。","2026-06-11 02:53:08","top_language"]