{"id":20098845,"url":"https://github.com/mark-5/p5-backbone-events","last_synced_at":"2025-10-12T16:16:49.967Z","repository":{"id":69269701,"uuid":"41603680","full_name":"mark-5/p5-backbone-events","owner":"mark-5","description":"a port of the Backbone.js event API","archived":false,"fork":false,"pushed_at":"2015-09-07T05:19:41.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T04:07:59.280Z","etag":null,"topics":["perl"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mark-5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-29T18:47:05.000Z","updated_at":"2017-02-15T05:06:31.000Z","dependencies_parsed_at":"2023-03-11T05:34:40.841Z","dependency_job_id":null,"html_url":"https://github.com/mark-5/p5-backbone-events","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/mark-5%2Fp5-backbone-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-backbone-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-backbone-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-backbone-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark-5","download_url":"https://codeload.github.com/mark-5/p5-backbone-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241541356,"owners_count":19979117,"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":["perl"],"created_at":"2024-11-13T17:06:53.930Z","updated_at":"2025-10-12T16:16:44.934Z","avatar_url":"https://github.com/mark-5.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nBackbone::Events - a port of the Backbone.js event API\n\n# VERSION\n\nversion 0.0.3\n\n# SYNOPSIS\n\n    package MyProducer {\n        use Moo;\n        with 'Backbone::Events';\n    };\n    my $pub = MyProducer-\u003enew;\n\n    package MySubscriber {\n        use Moo;\n        with 'Backbone::Events';\n    };\n    my $sub = MySubscriber-\u003enew;\n\n    $sub-\u003elisten_to($pub, 'some-event', sub { ... })\n    ...\n    $pub-\u003etrigger('some-event', qw(args for callback));\n\n# DESCRIPTION\n\nBackbone::Events is a Moo::Role which provides a simple interface for binding\nand triggering custom named events. Events do not have to be declared before\nthey are bound, and may take passed arguments.\n\nEvents can be optionally namespaced by prepending the event with the\nnamespace: '$namespace:$event'.\n\n# METHODS\n\n## on($event, $callback)\n\nBind a callback to an object.\n\nCallbacks bound to the special 'all' event will be triggered when any event\noccurs, and are passed the name of the event as the first argument.\n\nReturns the callback that was passed. This is mainly so anonymous functions\ncan be returned, and later passed back to 'off'.\n\n## off(\\[$event\\], \\[$callback\\])\n\nRemove a previously-bound callback from an object.\n\n## trigger($event, @args)\n\nTrigger callbacks for the given event.\n\n## once($event, $callback)\n\nJust like 'on', but causes the bound callback to fire only once before being\nremoved.\n\nReturns the callback that was passed. This is mainly so anonymous functions\ncan be returned, and later passed back to 'off'.\n\n## listen\\_to($other, $event, $callback)\n\nTell an object to listen to a particular event on an other object.\nThe other object must consume the Backbone::Events role.\n\nReturns the callback that was passed. This is mainly so anonymous functions\ncan be returned, and later passed back to 'stop\\_listening'.\n\n## stop\\_listening(\\[$other\\], \\[$event\\], \\[$callback\\])\n\nTell an object to stop listening to events.\n\n## listen\\_to\\_once($other, $event, $callback)\n\nJust like 'listen\\_to', but causes the bound callback to fire only once before\nbeing removed.\n\nReturns the callback that was passed. This is mainly so anonymous functions\ncan be returned, and later passed back to 'stop\\_listening'.\n\n# SEE ALSO\n\n[http://backbonejs.org/#Events](http://backbonejs.org/#Events)\n\n# AUTHOR\n\nMark Flickinger\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2015 by Mark Flickinger.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-5%2Fp5-backbone-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark-5%2Fp5-backbone-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-5%2Fp5-backbone-events/lists"}