{"id":16187512,"url":"https://github.com/fiatjaf/dreno","last_synced_at":"2026-04-28T08:04:55.935Z","repository":{"id":57216311,"uuid":"93060617","full_name":"fiatjaf/dreno","owner":"fiatjaf","description":"A framework that takes the best out of Cycle, React and Mobx.","archived":false,"fork":false,"pushed_at":"2019-07-08T18:15:55.000Z","size":5453,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T16:18:57.958Z","etag":null,"topics":["cyclejs","functional","mobx","react","reactive","streams","xstream"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fiatjaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-01T13:33:06.000Z","updated_at":"2020-07-30T12:42:31.000Z","dependencies_parsed_at":"2022-08-26T13:41:51.972Z","dependency_job_id":null,"html_url":"https://github.com/fiatjaf/dreno","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiatjaf%2Fdreno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiatjaf%2Fdreno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiatjaf%2Fdreno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiatjaf%2Fdreno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fiatjaf","download_url":"https://codeload.github.com/fiatjaf/dreno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247660418,"owners_count":20974881,"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":["cyclejs","functional","mobx","react","reactive","streams","xstream"],"created_at":"2024-10-10T07:22:15.675Z","updated_at":"2026-04-28T08:04:50.755Z","avatar_url":"https://github.com/fiatjaf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## what?\n\n**dreno** (portuguese for _drain_) is a small framework that combines the functional-reactive approach of [Cycle.js](https://cycle.js.org/) with the simplicity and scalability of state management given by [MobX](https://github.com/mobxjs/mobx).\n\n## why?\n\nBecause it had to be done. Read more about it [here](docs/why.md).\n\n## how does it work?\n\nBasically, you render some components with [React](https://facebook.github.io/react/) while accessing values from a **state** that is given by the `observable` function. Whenever the components emit events you want to react to, you `track` these events. Any tracked event can be accessed from the `select` function as a [xstream](https://github.com/staltz/xstream) stream. From the streams given by `select` and any other streams you may create (for example, for accessing external or browser APIs) you should be able to deduce the values that will then be passed to `observable`.\n\nSee some simple live [examples](http://rawgit.com/fiatjaf/dreno/master/examples/) with the code used to generate them.\n\n## getting started\n\n```\nnpm install dreno\n```\n\nYou may start your app by copypasting the following [boilerplate](http://rawgit.com/fiatjaf/dreno/master/examples/#/add-one):\n\n```js\n// app.js\n\nconst ReactDOM = require('react-dom')\nconst {observer, observable, track, select} = require('dreno')\n\nconst state = observable({\n  /* attributes that will be accessed\n   * directly from the components\n   * go here.\n   *\n   * count: select('a.add-one')\n   *   .events('click')\n   *   .mapTo(1)\n   *   .fold((acc, s) =\u003e acc + s, 0)\n   *   .startWith(0)\n   */\n})\n\nconst MainComponent = observer(\n  /* any React component class, either a stateless function,\n   * a class inheriting from React.Component or created with\n   * 'create-react-class'.\n   *\n   * only remember to set the event handlers to `track`,\n   * like \u003ca href='#' className='add-one' onClick={track}\u003eclick here to add 1\u003c/a\u003e\n   */\n)\n\nReactDOM.render(\n  MainComponent,\n  document.getElementById(/* your react root element */)\n)\n```\n\nApart from that, you can do all the usual React stuff, transpilation etc.\n\n---\n\nSome germans performing drainage:\n\n![picture of some germans performing drainage](docs/germans.jpg)\n\nbased on an idea first exposed at https://gist.github.com/fiatjaf/ece86e33b1f8846c8f8c318778b0895a.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiatjaf%2Fdreno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiatjaf%2Fdreno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiatjaf%2Fdreno/lists"}