windowed-observable
Advanced tools
Comparing version 0.3.4 to 0.4.0
export { Observer, ObserversArray, EventsArray, SubscriptionOptions, default as Observable, } from './observable'; |
@@ -1,4 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var observable_1 = require("./observable"); | ||
exports.Observable = observable_1.default; | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./windowed-observable.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./windowed-observable.cjs.development.js') | ||
} |
@@ -5,15 +5,10 @@ export declare const EVENTS = "__events__"; | ||
export declare type EventsArray = Array<any>; | ||
interface EventsArrayMap { | ||
[namespace: string]: EventsArray; | ||
} | ||
export declare type Observer = (data: any) => void; | ||
export declare type ObserversArray = Array<Observer>; | ||
interface ObserversArrayMap { | ||
[namespace: string]: ObserversArray; | ||
} | ||
declare global { | ||
interface Window { | ||
[SHARED]: any; | ||
[EVENTS]: EventsArrayMap; | ||
[OBSERVERS]: ObserversArrayMap; | ||
[SHARED]: { | ||
[EVENTS]: Record<string, EventsArray>; | ||
[OBSERVERS]: Record<string, ObserversArray>; | ||
}; | ||
} | ||
@@ -34,4 +29,4 @@ } | ||
set namespace(namespace: string); | ||
dispatch(data: any): void; | ||
publish(data: any): void; | ||
dispatch: (data: any) => void; | ||
subscribe(observer: Observer, options?: SubscriptionOptions): void; | ||
@@ -38,0 +33,0 @@ unsubscribe(observer: Observer): void; |
{ | ||
"name": "windowed-observable", | ||
"version": "0.3.4", | ||
"description": "Simple messaging api", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"author": "Luis Takahashi", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"module": "dist/windowed-observable.esm.js", | ||
"files": [ | ||
"/dist" | ||
"dist", | ||
"src" | ||
], | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"lint": "eslint --ignore-path .gitignore '*/**/*.{js,ts,tsx}' --quiet --fix", | ||
"prebuild": "rm -Rf dist/", | ||
"build": "tsc", | ||
"prepare": "yarn build", | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"test": "tsdx test", | ||
"lint": "tsdx lint", | ||
"prepare": "tsdx build", | ||
"validate": "npm-run-all --parallel lint test build" | ||
@@ -22,4 +28,2 @@ }, | ||
}, | ||
"author": "luis.takahashi", | ||
"license": "Unlicense", | ||
"bugs": { | ||
@@ -29,25 +33,21 @@ "url": "https://github.com/luistak/windowed-observable/issues" | ||
"homepage": "https://github.com/luistak/windowed-observable#readme", | ||
"peerDependencies": {}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "tsdx lint" | ||
} | ||
}, | ||
"prettier": { | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.24", | ||
"@typescript-eslint/eslint-plugin": "^2.18.0", | ||
"@typescript-eslint/parser": "^2.18.0", | ||
"eslint": "^6.8.0", | ||
"jest": "^24.9.0", | ||
"npm-run-all": "^4.1.5", | ||
"ts-jest": "^24.2.0", | ||
"typescript": "^3.7.2" | ||
}, | ||
"jest": { | ||
"transform": { | ||
"^.+\\.ts?$": "ts-jest" | ||
}, | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js" | ||
], | ||
"testPathIgnorePatterns": [ | ||
"dist", | ||
"node_modules" | ||
] | ||
"husky": "^4.2.5", | ||
"tsdx": "^0.13.2", | ||
"tslib": "^2.0.0", | ||
"typescript": "^3.9.7", | ||
"npm-run-all": "^4.1.5" | ||
} | ||
} |
@@ -5,7 +5,7 @@ # windowed-observable | ||
**windowed-observable** is a library for messaging using Observables, making it easier to communicate multiple apps or parts of an app using the window. It expose a Observable that behaves like a scoped Pub/Sub topic using namespaces. | ||
**windowed-observable** is a library for messaging using Observables, making it easier to communicate multiple apps or parts of an app using the window. It exposes an Observable that behaves like a scoped Pub/Sub topic using namespaces. | ||
## Installation | ||
```sh | ||
npm install windowed-obserbale | ||
npm install windowed-observable | ||
@@ -25,12 +25,10 @@ # or | ||
import { Observable } from 'windowed-observable'; | ||
const observable = new Observable('konoha'); | ||
observable.subscribe((ninja) => { | ||
console.log(ninja) | ||
}) | ||
observable.publish('Uchiha Shisui'); | ||
// > Uchiha Shisui | ||
``` | ||
### Retrieving latest event | ||
@@ -115,2 +113,2 @@ ```ts | ||
); | ||
``` | ||
``` |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
32082
5
15
0
400
112
1
1