{"id":13744037,"url":"https://github.com/Stray/robotlegs-utilities-SignalMediator","last_synced_at":"2025-05-09T02:32:18.600Z","repository":{"id":136459702,"uuid":"1463200","full_name":"Stray/robotlegs-utilities-SignalMediator","owner":"Stray","description":"SignalMediator and SignalMap to enable EventMap equivalence in robotlegs mediators.","archived":false,"fork":false,"pushed_at":"2011-03-10T13:17:25.000Z","size":526,"stargazers_count":39,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T05:03:01.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","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/Stray.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":"2011-03-10T11:28:21.000Z","updated_at":"2020-12-17T15:46:08.000Z","dependencies_parsed_at":"2023-03-13T11:02:25.696Z","dependency_job_id":null,"html_url":"https://github.com/Stray/robotlegs-utilities-SignalMediator","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/Stray%2Frobotlegs-utilities-SignalMediator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stray%2Frobotlegs-utilities-SignalMediator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stray%2Frobotlegs-utilities-SignalMediator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stray%2Frobotlegs-utilities-SignalMediator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stray","download_url":"https://codeload.github.com/Stray/robotlegs-utilities-SignalMediator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224802915,"owners_count":17372529,"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-08-03T05:01:01.750Z","updated_at":"2024-11-15T15:31:31.599Z","avatar_url":"https://github.com/Stray.png","language":"ActionScript","funding_links":[],"categories":["Frameworks"],"sub_categories":["RobotLegs Framework"],"readme":"**A Signal equivalent for the EventMap**\n\nThe robotlegs `Mediator` makes use of the `EventMap` to help with automatic clean-up when the mediator is removed.\n\nWithout clean up, memory leaks and duplication of listeners can occur as your views come and go from the stage and your mediators are created and destroyed.\n\nThe `SignalMediator` provides a `SignalMap` to handle this unmapping for you when the mediator is removed.\n\n**Usage**\n               \nWhere your mediator makes use of a `Signal` - whether injected or on the view - extend `SignalMediator`.\n\nInstead of registering a listener with a signal directly, make use of the `addToSignal` and `addOnceToSignal` methods.\n\n\toverride public function onRegister():void\n\t{\n\t\t// add normally\n\t\taddToSignal(someInjectedSignal, someHandler);       \n\t\t\n\t\t// add once\n\t\taddOnceToSignal(view.submit, submitHandler);\n\t}   \n\t\nThe `SignalMediator` will then make use of the `SignalMap` to add the handlers to these signals, and when the mediator is destroyed the handlers will all be unmapped. (Via the preRemove() method which is called by the `MediatorMap` automatically when views leave the stage).\n\n**To manually unmap a signal-listener**\n\nThe sugar methods `addToSignal` and `addOnceToSignal` are provided for convenience. You can also access the `SignalMap` property of the `SignalMediator` directly, and you should use this approach to manually remove a signal (for example in response to another signal or a normal event listener):\n\n\tsignalMap.removeFromSignal(someInjectedSignal, someHandler);\n\t                                                                                                                                        \n**You can also use the SignalMap outside of SignalMediator**\n\n`SignalMap` itself has no dependencies and can be used within a complex view, a service or any other place it might be useful to you. Even a controller if you're into that kind of thing.            \n\n**Compatibility**\n\nThis should be compatible with any 1.x robotlegs release, and at least 0.7 and 0.8 releases of signals.\nThe SignalMap makes use of the Vector class - available only in Flash Player 10+. It should be trivial to switch out the Vector for an array if you required FP 9 usage.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStray%2Frobotlegs-utilities-SignalMediator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStray%2Frobotlegs-utilities-SignalMediator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStray%2Frobotlegs-utilities-SignalMediator/lists"}