{"id":13434104,"url":"https://github.com/facebookarchive/flux","last_synced_at":"2025-10-05T19:30:16.519Z","repository":{"id":18830655,"uuid":"22046023","full_name":"facebookarchive/flux","owner":"facebookarchive","description":"Application Architecture for Building User Interfaces","archived":true,"fork":false,"pushed_at":"2023-03-21T23:41:43.000Z","size":5493,"stargazers_count":17491,"open_issues_count":6,"forks_count":3454,"subscribers_count":637,"default_branch":"main","last_synced_at":"2025-01-21T09:48:48.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://facebookarchive.github.io/flux/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookarchive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-07-20T23:33:08.000Z","updated_at":"2025-01-20T03:13:59.000Z","dependencies_parsed_at":"2023-10-12T01:33:30.093Z","dependency_job_id":null,"html_url":"https://github.com/facebookarchive/flux","commit_stats":null,"previous_names":["facebook/flux"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fflux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fflux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fflux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fflux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookarchive","download_url":"https://codeload.github.com/facebookarchive/flux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235432253,"owners_count":18989484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:46.045Z","updated_at":"2025-10-05T19:30:15.166Z","avatar_url":"https://github.com/facebookarchive.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## ⚠️ The Flux project has been archived and no further changes will be made. We recommend using more sophisticated alternatives like [Redux](http://redux.js.org/), [MobX](https://mobx.js.org/), [Recoil](https://recoiljs.org/), [Zustand](https://github.com/pmndrs/zustand), or [Jotai](https://github.com/pmndrs/jotai).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/facebookarchive/flux/blob/main/website/static/img/flux-logo-color.svg\" alt=\"logo\" width=\"20%\" /\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n  Flux\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  An application architecture for React utilizing a unidirectional data flow.\u003cbr\u003e\n\n  \u003ca href=\"https://github.com/facebook/flux/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-BSD%20-blue.svg\" alt=\"Licence Badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/flux\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/flux.svg?style=flat\" alt=\"Current npm package version.\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n\u003cimg src=\"./img/flux-diagram-white-background.png\" style=\"width: 100%;\" /\u003e\n\n## Getting Started\n\nStart by looking through the [guides and examples](./examples) on Github. For more resources and API docs check out [facebook.github.io/flux](https://facebookarchive.github.io/flux).\n\n## How Flux works\n\nFor more information on how Flux works check out the [Flux Concepts](./examples/flux-concepts) guide, or the [In Depth Overview](https://facebookarchive.github.io/flux/docs/in-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://nodejs.org/api/events.html#events_class_eventemitter) as a basis for `Stores` and [React](https://github.com/facebook/react) 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://www.npmjs.org/package/flux), 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://facebookarchive.github.io/flux/docs/dispatcher).\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/utils';\n\nclass CounterStore extends ReduceStore\u003cnumber\u003e {\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](./examples) and [documentation](https://facebookarchive.github.io/flux/docs/flux-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://gulpjs.com/)-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/to/this/directory/Flux').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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2Fflux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookarchive%2Fflux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2Fflux/lists"}