{"id":14954727,"url":"https://github.com/applitopia/duxen","last_synced_at":"2026-01-18T01:35:51.941Z","repository":{"id":22381685,"uuid":"96085233","full_name":"applitopia/duxen","owner":"applitopia","description":"High performance data engine maintaining complex immutable state for reactive applications. Fully integrated with Immutable.js, Redux, and Meteor.","archived":false,"fork":false,"pushed_at":"2023-01-03T15:15:57.000Z","size":2112,"stargazers_count":1,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-14T09:32:53.881Z","etag":null,"topics":["immutablejs","meteor","redux"],"latest_commit_sha":null,"homepage":"https://applitopia.github.io/duxen","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/applitopia.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-07-03T07:57:04.000Z","updated_at":"2022-02-06T15:30:25.000Z","dependencies_parsed_at":"2023-01-11T21:36:08.219Z","dependency_job_id":null,"html_url":"https://github.com/applitopia/duxen","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applitopia%2Fduxen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applitopia%2Fduxen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applitopia%2Fduxen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applitopia%2Fduxen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/applitopia","download_url":"https://codeload.github.com/applitopia/duxen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271489,"owners_count":20911586,"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":["immutablejs","meteor","redux"],"created_at":"2024-09-24T13:05:09.232Z","updated_at":"2026-01-18T01:35:51.907Z","avatar_url":"https://github.com/applitopia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![duxen](http://applitopia.github.io/duxen/duxen.svg)\n\nDUXEN\n=====\n[![npm version](https://badge.fury.io/js/duxen.svg)](https://badge.fury.io/js/duxen)\n[![jest](https://img.shields.io/badge/tested_with-jest-brightgreen.svg)](https://facebook.github.io/jest/)\n[![dependencies](https://img.shields.io/david/applitopia/duxen.svg)](https://david-dm.org/applitopia/duxen)\n[![devDependencies](https://img.shields.io/david/dev/applitopia/duxen.svg)](https://david-dm.org/applitopia/duxen?type=dev)\n[![Gitter](https://img.shields.io/gitter/room/applitopia/duxen.svg)](https://gitter.im/duxen/Lobby)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nHigh performance data engine maintaining complex immutable state for reactive applications.\nFully integrated with [Immutable.js](https://facebook.github.io/immutable-js/), [Redux](https://redux.js.org), and [Meteor](https://meteor.com).\n\nSee demo here: [https://stackblitz.com/edit/duxen-demo](https://stackblitz.com/edit/duxen-demo)\n\nHuh?\n====\nRedux is an amazing concept that shows how to manage application data in a predictable state containers. It is actually a tiny library (2kB) with a simple container that receives actions and forwards them to reducers. The actions and reducers themselves have to be fully designed and developed from scratch. Although Redux applications are elegant, behave consistently, and are easy to test, their state management logic is usually scattered across many small files and developers may end up typing a lot of repetitive boilerplate code. Moreover, the reducers must be written as pure functions with no side effects and they have to modify the application state in an immutable way. This can become difficult and error prone especially if application logic is complex.\n\nSo here comes DUXEN, the Redux Engine.\n\nInstead of writing individual reducers and action creators, the developer is focusing on the whole application state. The state is described with a schema that contains simple values, collections, and views which are seamlessly transforming the data in collections into their presentation form. The DUXEN compiles the schema, generates the reducers, and provides all the action creators. The resulting application state is built by DUXEN as one large immutable object using Immutable.js library.\n\n\nInstallation\n------------\n\n```shell\nnpm install duxen\n```\n\nDevelopment\n-----------\n\nSetup:\n\n```shell\ngit clone https://github.com/applitopia/duxen.git\ncd duxen\nnpm install\n```\n\nLint:\n```shell\nnpm run lint\n```\n\nBuild:\n```shell\nnpm run build\n```\n\nTest:\n```shell\nnpm test\n```\n\nLint, Build, \u0026 Test:\n```shell\nnpm run all\n```\n\nUpdate Dependencies:\n```shell\nnpm update --save\n```\n\nExample\n------\nDefine your DUXEN schema:\n\n```js\nconst cmp=(a,b)=\u003e(a\u003eb?1:(a\u003cb?-1:0))\n\nconst schema = {\n\n  'todosFilter': {\n    type: 'value',\n    initValue: \"\",\n  },\n\n  'todosLimit': {\n    type: 'value',\n    initValue: 10,\n  },\n\n  'todos': {type: 'collection'},\n\n  'todosView': {\n    type:'view',\n    sourceName: 'todos',\n    props: ['todosFilter', 'todosLimit'],\n    recipe: (seq, props)=\u003eseq\n      .filter(v=\u003ev.get('text').indexOf(props.todosFilter) \u003e= 0)\n      .sort((a, b)=\u003ecmp(a.get('text'), b.get('text')))\n      .take(props.todosLimit),\n  },\n\n  'todosCnt': {\n    type:'view',\n    sourceName: 'todosView',\n    props: [],\n    recipe: (seq)=\u003eSeq({cnt: seq.count()})\n  },\n\n  'todosCompletedCnt': {\n    type:'view',\n    sourceName: 'todosView',\n    props: [],\n    recipe: (seq, props)=\u003e{\n      const cnt = seq\n      .filter(v=\u003ev.get('completed'))\n      .count();\n      return Seq({cnt});\n    }\n  },\n\n}\n```\nCreate a DUXEN engine:\n```js\nimport { createEngine } from 'duxen'\n\nconst engine = createEngine(schema)\n```\nGet a reducer from the engine and attach it to a Redux store:\n```js\nimport { createStore } from 'redux'\n\nconst store = createStore(engine.reducer())\n\n```\nCreate actions and dispatch them to the store:\n```js\n// Create an action that changes the value of the filter\nconst action = engine.value('todosFilter', \"Get milk\");\n\n// Dispatch the action to the Redux store\nstore.dispatch(action);\n\n// Get the updated state from the store\nconst state = store.getState();\n```\n\nLicense\n-------\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplitopia%2Fduxen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplitopia%2Fduxen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplitopia%2Fduxen/lists"}