{"id":17271639,"url":"https://github.com/rvikmanis/redux-fp","last_synced_at":"2025-04-14T08:14:05.916Z","repository":{"id":57350772,"uuid":"66137022","full_name":"rvikmanis/redux-fp","owner":"rvikmanis","description":"Functional programming helpers for Redux.","archived":false,"fork":false,"pushed_at":"2017-11-05T13:39:26.000Z","size":88,"stargazers_count":28,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T07:39:01.713Z","etag":null,"topics":["functional-programming","helpers","point-free","reducer","redux","utility-library"],"latest_commit_sha":null,"homepage":"","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/rvikmanis.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":"2016-08-20T08:36:35.000Z","updated_at":"2021-11-18T17:04:39.000Z","dependencies_parsed_at":"2022-09-15T01:53:29.471Z","dependency_job_id":null,"html_url":"https://github.com/rvikmanis/redux-fp","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/rvikmanis%2Fredux-fp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvikmanis%2Fredux-fp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvikmanis%2Fredux-fp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvikmanis%2Fredux-fp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvikmanis","download_url":"https://codeload.github.com/rvikmanis/redux-fp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248843942,"owners_count":21170495,"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":["functional-programming","helpers","point-free","reducer","redux","utility-library"],"created_at":"2024-10-15T08:45:50.696Z","updated_at":"2025-04-14T08:14:05.894Z","avatar_url":"https://github.com/rvikmanis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-fp\n\nFunctional programming helpers for Redux.\n\n[![Build Status](https://travis-ci.org/rvikmanis/redux-fp.svg?branch=master)](https://travis-ci.org/rvikmanis/redux-fp)\n[![Code Coverage](https://codecov.io/gh/rvikmanis/redux-fp/branch/master/graph/badge.svg)](https://codecov.io/gh/rvikmanis/redux-fp)\n\n**Table of contents**\n\n- [Updaters vs. reducers](#updaters-vs-reducers)\n- [Purpose](#purpose)\n- [Installation](#installation)\n- [API reference](#api-reference)\n\n## Updaters vs. reducers\n\n*Updater* is a type of function that takes an action and\nreturns another function that takes the state and produces a result.\n\n```javascript\naction =\u003e state =\u003e {\n  // Do something\n}\n```\n\nYes, they are just curried reducers with reversed argument order.\n\n### Using with utility libraries\n\nUnlike reducers, updaters compose nicely with existing tools like lodash/fp or Ramda.\n\nLet's create an updater that replaces a part\nof the state with the action's payload. We will use lodash/fp's `set` helper to illustrate the point.\n\n```javascript\nimport { set } from 'lodash/fp'\nconst changeFoo = action =\u003e set('foo', action.payload)\n```\n\nNote that I've eliminated state from the definition of our updater, and called `set` with two, not three, arguments.\nThis works because when `set` is called without\nthe third argument, it returns a function that takes the missing argument and produces a result.\nThat function becomes the inner function of our updater and receives the state.\n\nThe paradigm is called [point-free style](https://en.wikipedia.org/wiki/Tacit_programming), and\nif you're not familiar with it, check out\n[Lucas Reis' introductory article](http://lucasmreis.github.io/blog/pointfree-javascript/).\n\n### Compatibility\n\nTo create a Redux store, just wrap the root updater in a reducer:\n\n```javascript\ncreateStore((s, a) =\u003e updater(a)(s))\n```\n\n## Purpose\n\n*redux-fp* provides a set of useful utilities and enhancers like `combine`, `withDefaultState` or `mapState`\nthat help working with updaters.\n\nCheck out the [API reference](#api-reference) for a full list of helpers, complete with descriptions and usage examples.\n\n## Installation\n\n**Node**\n\n`npm i --save redux-fp`\n\nOr as a development dependency:\n\n`npm i --save-dev redux-fp`\n\n**Browser**\n\n```html\n\u003cscript src=\"https://unpkg.com/redux-fp/dist/redux-fp.min.js\"\u003e\u003c/script\u003e\n```\n\nMakes the library available globally as `ReduxFp`.\n\n## API reference\n\nSee [docs/API.md](docs/API.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvikmanis%2Fredux-fp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvikmanis%2Fredux-fp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvikmanis%2Fredux-fp/lists"}