pub repository
mirror.p-hatan.irobservable
0.1.6Easy registration and notification of events
This package is discontinued upstream.
Readme
Synopsis
Observable provides a convenient mechanism of registering for events and dispatching notifications to listening clients.
How to use
Inheriting from Observable
The easiest way to use Observable is by inheriting from Observable, as given
by:
import 'package:obvervable/obvervable.dart';
class Foo extends Observable
Clients register for notifications as illustrated in the following snippet:
Foo myFoo = new Foo();
myFoo.on.anEvent(() => print("AnEvent fired"));
Dispatching of events is done by invoking the dispatch method:
class Foo extends Observable
{
.
:
.
void method()
{
// carry out operations
observer.dispatch("anEvent");
}
}
Optionally, an argument can be passed in to dispatch:
observer.dispatch("anEvent", "anArg");
The above would cause "anArg" to be passed to be every event observer.
Composition
Since Dart does not support multiple inheritance, you may at times not be able to use the method outlined above. The alternative, then, is to use composition. Example:
import 'package:observable/observer.dart';
import 'package:observable/observer_events.dart';
class Foo extends SomeOtherClass
{
Observer observer;
ObserverEvents on;
Foo()
: observer = new Observer()
{
on = observer.on;
}
}
Clients register for notifications and events are dispatched in the same manner as exemplified in the preceding section.
Changelog
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add observablepubspec.yaml
name: observable
version: 0.1.6
author: Miguel Guedes <miguel.a.guedes@gmail.com>
description: Easy registration and notification of events
homepage: https://github.com/miguel-guedes/observableVersion history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.1.0 | 2014-06-06T16:41:32.001090Z | Download | d6fdf1e65de6103941a7377d4d268d4147c47850536b70850be8686a4bb8282f |
| 0.1.1 | 2014-06-06T17:10:06.910100Z | Download | 8aa5feb72be0bfdb8d344ddd2da3dd13a2630da5e71dc40c8e30ba020fbeb59b |
| 0.1.2 | 2014-06-06T18:12:36.721340Z | Download | 79d8074f5f771078c368508b836584dbce4a2d5b74cb80800d4cb03cc14950c2 |
| 0.1.3 | 2014-06-08T15:07:06.198290Z | Download | 142ddf0b61a4b653bda1a28a22ed2a57bfa21620f21daacee603a7087e875ba5 |
| 0.1.4 | 2014-06-08T15:08:37.263640Z | Download | ac8da8a48ed40a2c169ed49135b277897a5c710f101bf88884f6477f0f144080 |
| 0.1.5 | 2014-06-11T12:09:08.919140Z | Download | aed2d42592befd39e1ca321631118d99538dff6bbfcc8fab70bcb3fac6df37d2 |
| 0.1.6 | 2014-06-11T13:46:07.823640Z | Download | 98674349a58d899c16c21927b0b625c7299e9b35872150a92f8727a74a0200c7 |
| 0.14.0 | 2016-09-23T20:48:35.289Z | Download | c5fc18c79e862c880c604568ac949e427d82214098f250d890ec824461940996 |
| 0.14.0+1 | 2016-09-26T17:05:37.029Z | Download | 549d63f721775224e229510760304766448b02c62c48f248192ea3a3c36aed9b |
| 0.15.0+1 | 2016-11-17T01:37:36.985Z | Download | d8427a2b87da22a818d2b4e1b37c7f45775e26e0ccfbd63884c1d85a4a945111 |
| 0.16.0 | 2016-11-17T18:32:04.548Z | Download | b8abdac0b1ac8b296a961f6ae24247ec15a30755b734b68f67d1bf8394e87ff7 |
| 0.17.0 | 2016-11-17T23:17:29.180Z | Download | 01328f5b4c877837d64440daf0e8c343a122948689d195708953d4dad0cf013b |
| 0.17.0+1 | 2016-11-21T18:59:50.788Z | Download | 8a6c6e21e1a5fc032fc49cfc28c5c3574962dbed3252d8570a5b1e4174c73025 |
| 0.18.0 | 2016-11-22T04:50:21.072Z | Download | be648ac636727693806487e7e07a640665336fd2dff97582c5fcbd9e7ed70876 |
| 0.18.1 | 2016-11-22T20:16:21.692Z | Download | 44e76715dee5848404d4c1d6b0a39333f6f791d8c7c48e2bb4abc2204995dfbd |
| 0.19.0 | 2016-11-23T01:31:07.467Z | Download | 371d4356dc92f71a004c71301fecb5237f43dff5e1f789ff79edc844078c0cde |
| 0.20.1 | 2016-11-29T03:07:45.483Z | Download | ba572ba1f5f11072e7109490ce416cb1338528c54a8561cadf154fe2d630397e |
| 0.20.2 | 2016-12-20T07:22:32.443Z | Download | b9b4f7107089afb58f73346ddf9da4e64e56a02e62b729694c0129e484cc9d06 |
| 0.20.4 | 2017-02-25T04:21:45.913Z | Download | d6308bf35fc8803fed7e026fc991cf2ad4e02be63055a15eac9a2c51b3761d63 |
| 0.20.4+1 | 2017-04-04T20:02:29.019802Z | Download | 5382b3f529e69b44888baaa595eca60127290b4d26c223fd996a2d6561b71933 |
| 0.20.4+2 | 2017-12-27T18:49:28.130687Z | Download | 375870ad899a83138014f715c4031785445bcc0860b010ab08523e3ceb37b61e |
| 0.20.4+3 | 2018-01-09T01:26:36.225295Z | Download | 898df861aa2c37614f81e00d5da4e6e50496a925f16a81a7e49b1ed5967df464 |
| 0.21.0 | 2018-02-12T18:09:51.151116Z | Download | ebb9ff4bd8b957ef2bc102e1e604b04cab48b2ca9fcf5873854feae1c87d8a99 |
| 0.21.1 | 2018-03-01T02:04:09.492545Z | Download | 60c73ae870a0f001a23ce12678d815f3b932032763413d1bb15bd514af169301 |
| 0.21.2 | 2018-03-07T23:28:47.382783Z | Download | ad3b0443325a0f10ca328555bd68d287f27d06d1a81b1abb065ccf413353957e |
| 0.21.3 | 2018-03-13T16:59:28.153540Z | Download | f4e963b40cd0b460122a958ff77ccf97597a85e39cfab0b7303d9437a5c8f6b0 |
| 0.22.0 | 2018-03-19T17:07:57.288351Z | Download | a7722c1d562039d433cb6b8cd257d6bc784d26ce044725409065d16136dc124a |
| 0.22.1 | 2018-03-23T23:29:35.934828Z | Download | 2a88d6c6182bb1cc3d95841ff40a6f2bd54e527f76b21693d32680ea127f5f9f |
| 0.22.1+1 | 2018-05-03T16:19:13.923304Z | Download | 631b89955023d9dd0a456cd21de780259bc759bbe98277fe7a1ebc6b6bb41e6f |
| 0.22.1+2 | 2018-05-18T22:13:21.263251Z | Download | cb24c2888248a842710be263b9a981eba24563c6fd8351c08cc3b52b5ac765a7 |
| 0.22.1+3 | 2018-05-25T17:11:35.455328Z | Download | dda14d0c17ef7846f748aca2c8cdf388f326cc1b66bd963779d0f20cce267692 |
| 0.22.1+4 | 2018-07-23T18:41:54.734062Z | Download | e45aeef60f47c2696b36718b383aad7cef9a7b252dcb6d16df6261906e96b957 |
| 0.22.1+5 | 2018-12-10T22:17:15.043501Z | Download | a99d958c8483e369da3ab6832148364dc73fc22f6ee6c9792cbc8ecae7964e27 |
| 0.22.2 | 2019-02-05T22:26:59.772301Z | Download | bb74db48ca45dc26ae0e3f15334e2bd844ceacc23a31e9c18045df311833129f |
| 0.23.0 | 2021-03-23T17:30:12.296140Z | Download | 72aeca9b76959826ca380bfe2517bc21a6a25d56f41ab620f1421728ffa5e564 |
| 0.24.0 | 2021-12-01T23:27:45.159724Z | Download | 6be2c1236cd4130a0e752895b0d3dee6d438d4c0b6775b8fe5808cf981aa9a70 |
Dependencies
No direct dependencies declared.