ts-observer-pattern
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -1,2 +0,1 @@ | ||
import {Observer} from "./Observer" | ||
import {Subject} from "./Subject" | ||
export * from './src/index' |
{ | ||
"name": "ts-observer-pattern", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Interfaces to help working with the Observer Pattern", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
# ts-observer-pattern | ||
A simple observer pattern implementation in TypeScript. | ||
```npm install ts-observer-pattern``` | ||
``` | ||
npm install ts-observer-pattern | ||
``` | ||
# Example | ||
## Example | ||
In the example that follows, I'm implementing a relationship bettween a magazine and it subscribers | ||
``` | ||
```TypeScript | ||
// Magazine.ts | ||
import { Subject } from 'ts-observer-pattern' | ||
class Magazine extends Subject | ||
@@ -24,3 +29,6 @@ { | ||
``` | ||
```TypeScript | ||
// Subscriber.ts | ||
import { Observer } from 'ts-observer-pattern' | ||
class Subscriber implements Observer | ||
@@ -35,3 +43,7 @@ { | ||
``` | ||
```TypeScript | ||
// main.ts | ||
import { Magazine } from './Magazine' | ||
import { Subscriber } from './Subscriber' | ||
let Coders = new Magazine | ||
@@ -38,0 +50,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2549
6
32
55