{"id":16847455,"url":"https://github.com/fabiosantoscode/add-functions","last_synced_at":"2025-03-18T07:17:14.151Z","repository":{"id":57173148,"uuid":"152093339","full_name":"fabiosantoscode/add-functions","owner":"fabiosantoscode","description":"Add two functions together and choose when the original one gets called!","archived":false,"fork":false,"pushed_at":"2018-10-24T15:33:10.000Z","size":273,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T13:41:39.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fabiosantoscode.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":"2018-10-08T14:25:16.000Z","updated_at":"2018-10-24T15:33:12.000Z","dependencies_parsed_at":"2022-08-24T14:41:10.898Z","dependency_job_id":null,"html_url":"https://github.com/fabiosantoscode/add-functions","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/fabiosantoscode%2Fadd-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fadd-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fadd-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fadd-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiosantoscode","download_url":"https://codeload.github.com/fabiosantoscode/add-functions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173553,"owners_count":20410300,"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-10-13T13:08:00.571Z","updated_at":"2025-03-18T07:17:14.123Z","avatar_url":"https://github.com/fabiosantoscode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# add-functions\n\n[![Build Status](https://travis-ci.org/fabiosantoscode/add-functions.svg?branch=master)](https://travis-ci.org/fabiosantoscode/add-functions) [![Coverage Status](https://coveralls.io/repos/github/fabiosantoscode/add-functions/badge.svg)](https://coveralls.io/github/fabiosantoscode/add-functions)\n\nAdd two functions together and choose when the original one gets called!\n\n# require('add-functions')(a, (callOriginal) =\u003e { callOriginal(); foo()})\nAdds one or more functions together. Functions will take an additional callOriginal argument. This function will call the function before yours in the added functions.\n\n```javascript\n\nconst a = n =\u003e n + 1\nconst b = (n, callPrevious) =\u003e n + callPrevious() + 1\n\nconst c = addFunctions(a, b)\n\nc(0)  // -\u003e 2\n```\n\n```javascript\nconst asynchronouslyAdd2 = addFunctions(\n    () =\u003e getPromise(),\n    previous =\u003e previous().then(p =\u003e p + 1),\n    previous =\u003e previous().then(p =\u003e p + 1),\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiosantoscode%2Fadd-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiosantoscode%2Fadd-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiosantoscode%2Fadd-functions/lists"}