{"id":17139460,"url":"https://github.com/wking-io/lemonade","last_synced_at":"2025-03-24T07:35:05.662Z","repository":{"id":143885623,"uuid":"120306342","full_name":"wking-io/lemonade","owner":"wking-io","description":"Composable AJAX requests that return a Future Data Type","archived":false,"fork":false,"pushed_at":"2018-10-17T14:45:58.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T08:11:48.427Z","etag":null,"topics":["composable-ajax-requests","currying","functional-programming","futures","lemonade","monad"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wking-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-05T13:10:04.000Z","updated_at":"2018-10-17T14:44:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0c3e91d-9f0b-4f08-8f5f-25cdc8d493cf","html_url":"https://github.com/wking-io/lemonade","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Flemonade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Flemonade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Flemonade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Flemonade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wking-io","download_url":"https://codeload.github.com/wking-io/lemonade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245228108,"owners_count":20581003,"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":["composable-ajax-requests","currying","functional-programming","futures","lemonade","monad"],"created_at":"2024-10-14T20:12:17.063Z","updated_at":"2025-03-24T07:35:05.628Z","avatar_url":"https://github.com/wking-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lemonade\n\nComposable AJAX requests that return a Future data type.\n\n\u003e This package used to be this project: https://github.com/runlevel3/lemonade\n\u003e However, that project has now been deprecated for this package name. Please visit the\n\u003e github project if you still need the old project.\n\n## Usage\n\n\u003e `yarn install lemonade`\nor\n\u003e `npm install lemonade`\n\nLemonade is bundled to work with EcmaScript version 5.\n\nFor older environments you may need to polyfill the following\nfunction: [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign).\n\n### CommonJS Module\n\n\u003c!-- eslint-disable no-var --\u003e\n\n\u003c!-- eslint-disable padding-line-between-statements --\u003e\n\n```js\nvar { compose, lift } = require('ramda');\nvar { getJson } = require('lemonade');\nvar { dom, getProp, setProp } = require('saladbar');\n\n// Given you want to add an API response to this html\n// \u003cp class=\"default\"\u003e\u003c/p\u003e\n\n// API Endpoint\nvar endpoint = 'https://jsonplaceholder.typicode.com/posts/1';\n\n// Function to hit enpoint and return the body prop of the response\nvar postBody = compose(getProp('body'), getJson);\n\n// Lifted function that will set the innerHTML of the passed in DOM Element with the API response\nvar setHtmlWithPostBody = lift((data, el) =\u003e setProp('innerHTML', data, el));\n\n// Load the function and then fork it with the results\nsetHtmlWithPostBody(postBody(endpoint), dom('.default'))\n.fork(console.error, console.log);\n//\u003e DOM Element\n```\n\n### EcmaScript Module\n\nThe `package.json` sets a `module`-field for build-tools like [Rollup](https://rollupjs.org/guide/en).\n\n```js\nimport { compose, lift } from 'ramda';\nimport { getJson } from 'lemonade';\nimport { dom, getProp, setProp } from 'saladbar';\n\n// Given you want to add an API response to this html\n// \u003cp class=\"default\"\u003e\u003c/p\u003e\n\n// API Endpoint\nconst endpoint = 'https://jsonplaceholder.typicode.com/posts/1';\n\n// Function to hit enpoint and return the body prop of the response\nconst postBody = compose(getProp('body'), getJson);\n\n// Lifted function that will set the innerHTML of the passed in DOM Element with the API response\nconst setHtmlWithPostBody = lift((data, el) =\u003e setProp('innerHTML', data, el));\n\n// Load the function and then fork it with the results\nsetHtmlWithPostBody(postBody(endpoint), dom('.default'))\n.fork(console.error, console.log);\n//\u003e DOM Element\n```\n\n### Global Bundle (CDN)\n\nLemonade is hosted in full with all of its dependencies at:\n[https://cdn.rawgit.com/wking-io/lemonade/14005c66/lib/bundle.js](https://cdn.rawgit.com/wking-io/lemonade/14005c66/lib/bundle.js)\n\nThis script will add `lemonade` to the global scope.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwking-io%2Flemonade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwking-io%2Flemonade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwking-io%2Flemonade/lists"}