{"id":18455919,"url":"https://github.com/idyll-lang/idyll-context-compose","last_synced_at":"2025-04-22T17:15:01.814Z","repository":{"id":57271336,"uuid":"158456954","full_name":"idyll-lang/idyll-context-compose","owner":"idyll-lang","description":"Compose multiple contexts; makes it easier to work with multiple runtime plugins.","archived":false,"fork":false,"pushed_at":"2018-11-22T04:40:52.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T23:26:29.440Z","etag":null,"topics":[],"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/idyll-lang.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-11-20T22:03:03.000Z","updated_at":"2018-11-22T04:40:54.000Z","dependencies_parsed_at":"2022-09-01T00:22:04.920Z","dependency_job_id":null,"html_url":"https://github.com/idyll-lang/idyll-context-compose","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idyll-lang%2Fidyll-context-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idyll-lang%2Fidyll-context-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idyll-lang%2Fidyll-context-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idyll-lang%2Fidyll-context-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idyll-lang","download_url":"https://codeload.github.com/idyll-lang/idyll-context-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844294,"owners_count":21170547,"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-11-06T08:09:31.840Z","updated_at":"2025-04-22T17:15:01.789Z","avatar_url":"https://github.com/idyll-lang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# idyll-context-compose\n\nCompose multiple contexts; makes it easier to work with multiple [Idyll runtime plugins](https://github.com/idyll-lang/idyll-plugins).\n\n## Example\n\n\nSay you want to use a runtime plugin like [url-state](idyll-plugin-url-state) but also add your own custom context processing code:\n\n\n*context.js* \n```js\nconst URLState = require('idyll-plugin-url-state');\nconst compose = require('idyll-context-compose');\n\nconst customContext = (ctx) =\u003e {\n  // To listen for changes:\n  ctx.onUpdate((newData) =\u003e {\n    console.log('[custom context]', newData);\n  })\n}\n\nmodule.exports = compose(URLState, customContext);\n```\n\n## Installation\n\n```\n$ npm install --save -context-compose\n```\n\n### Adding a custom context file\n\nTo use this library, you'll need to tell Idyll to use a custom context. To do that, create a `context.js` file, and point Idyll to in in `package.json`:\n\n```\n\"idyll\": {\n  \"context\": \"./context.js\"\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidyll-lang%2Fidyll-context-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidyll-lang%2Fidyll-context-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidyll-lang%2Fidyll-context-compose/lists"}