rxjs-hooks
Advanced tools
Comparing version 0.6.2 to 0.7.0
import { Observable, BehaviorSubject } from 'rxjs'; | ||
import { RestrictArray, Not } from './type'; | ||
export declare type VoidableEventCallback<EventValue> = EventValue extends void ? () => void : (e: EventValue) => void; | ||
export declare type EventCallbackState<EventValue, State, Inputs = void> = [VoidableEventCallback<EventValue>, [State extends void ? null : State, BehaviorSubject<State | null>, BehaviorSubject<RestrictArray<Inputs> | null>]]; | ||
export declare type ReturnedState<EventValue, State, Inputs> = [EventCallbackState<EventValue, State, Inputs>[0], EventCallbackState<EventValue, State, Inputs>[1][0]]; | ||
export declare type EventCallbackState<EventValue, State, Inputs = void> = [ | ||
VoidableEventCallback<EventValue>, | ||
[ | ||
State extends void ? null : State, | ||
BehaviorSubject<State | null>, | ||
BehaviorSubject<RestrictArray<Inputs> | null> | ||
] | ||
]; | ||
export declare type ReturnedState<EventValue, State, Inputs> = [ | ||
EventCallbackState<EventValue, State, Inputs>[0], | ||
EventCallbackState<EventValue, State, Inputs>[1][0] | ||
]; | ||
export declare type EventCallback<EventValue, State, Inputs> = Not<Inputs extends void ? true : false, (eventSource$: Observable<EventValue>, state$: Observable<State>, inputs$: Observable<RestrictArray<Inputs>>) => Observable<State>, (eventSource$: Observable<EventValue>, state$: Observable<State>) => Observable<State>>; | ||
@@ -7,0 +17,0 @@ export declare function useEventCallback<EventValue>(callback: EventCallback<EventValue, void, void>): ReturnedState<EventValue, void | null, void>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useEventCallback = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -4,0 +5,0 @@ var react_1 = require("react"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useObservable = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -4,0 +5,0 @@ var rxjs_1 = require("rxjs"); |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=type.js.map |
import { Observable, BehaviorSubject } from 'rxjs'; | ||
import { RestrictArray, Not } from './type'; | ||
export declare type VoidableEventCallback<EventValue> = EventValue extends void ? () => void : (e: EventValue) => void; | ||
export declare type EventCallbackState<EventValue, State, Inputs = void> = [VoidableEventCallback<EventValue>, [State extends void ? null : State, BehaviorSubject<State | null>, BehaviorSubject<RestrictArray<Inputs> | null>]]; | ||
export declare type ReturnedState<EventValue, State, Inputs> = [EventCallbackState<EventValue, State, Inputs>[0], EventCallbackState<EventValue, State, Inputs>[1][0]]; | ||
export declare type EventCallbackState<EventValue, State, Inputs = void> = [ | ||
VoidableEventCallback<EventValue>, | ||
[ | ||
State extends void ? null : State, | ||
BehaviorSubject<State | null>, | ||
BehaviorSubject<RestrictArray<Inputs> | null> | ||
] | ||
]; | ||
export declare type ReturnedState<EventValue, State, Inputs> = [ | ||
EventCallbackState<EventValue, State, Inputs>[0], | ||
EventCallbackState<EventValue, State, Inputs>[1][0] | ||
]; | ||
export declare type EventCallback<EventValue, State, Inputs> = Not<Inputs extends void ? true : false, (eventSource$: Observable<EventValue>, state$: Observable<State>, inputs$: Observable<RestrictArray<Inputs>>) => Observable<State>, (eventSource$: Observable<EventValue>, state$: Observable<State>) => Observable<State>>; | ||
@@ -7,0 +17,0 @@ export declare function useEventCallback<EventValue>(callback: EventCallback<EventValue, void, void>): ReturnedState<EventValue, void | null, void>; |
{ | ||
"name": "rxjs-hooks", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"description": "React hooks for RxJS", | ||
@@ -15,5 +15,8 @@ "module": "dist/esm/index.js", | ||
"build:cjs": "rm -rf dist/cjs && tsc -p src/tsconfig.json --module commonjs --target es5 --outDir dist/cjs", | ||
"lint": "tslint -c tslint.json -p src/tsconfig.json", | ||
"start": "webpack-dev-server --config ./tools/webpack.config.js --progress --color", | ||
"test": "NODE_ENV=test jest --no-cache --ci" | ||
"test": "NODE_ENV=test jest --no-cache --ci", | ||
"lint": "yarn lint:eslint && yarn lint:tsc", | ||
"lint:eslint": "eslint . --ext .ts,.tsx --fix --max-warnings 0", | ||
"lint:tsc": "tsc -p ./tsconfig.json --noEmit", | ||
"prepare": "husky install" | ||
}, | ||
@@ -25,40 +28,45 @@ "repository": { | ||
"devDependencies": { | ||
"@types/jest": "^25.1.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/lodash": "^4.14.149", | ||
"@types/react-dom": "^16.9.4", | ||
"@types/react-test-renderer": "^16.9.1", | ||
"@types/sinon": "^7.5.1", | ||
"@types/react-dom": "^17.0.0", | ||
"@types/react-test-renderer": "^17.0.0", | ||
"@types/sinon": "^9.0.0", | ||
"@types/sinon-chai": "^3.2.3", | ||
"@types/webpack": "^4.41.0", | ||
"@typescript-eslint/eslint-plugin": "^4.19.0", | ||
"@typescript-eslint/parser": "^4.19.0", | ||
"browser-resolve": "^2.0.0", | ||
"codecov": "^3.6.1", | ||
"fork-ts-checker-webpack-plugin": "^4.0.1", | ||
"eslint": "^7.22.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-react": "^7.23.1", | ||
"fork-ts-checker-webpack-plugin": "^6.0.0", | ||
"happypack": "^5.0.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"husky": "^4.0.0", | ||
"jest": "^25.1.0", | ||
"html-webpack-plugin": "^5.0.0", | ||
"husky": "^5.2.0", | ||
"jest": "^26.0.1", | ||
"lint-staged": "^10.0.1", | ||
"prettier": "^1.19.1", | ||
"react": "16.13.0", | ||
"react-dom": "16.13.0", | ||
"react-test-renderer": "16.13.0", | ||
"prettier": "^2.0.1", | ||
"react": "17.0.1", | ||
"react-dom": "17.0.1", | ||
"react-test-renderer": "17.0.1", | ||
"rxjs": "^6.5.3", | ||
"sinon": "^9.0.0", | ||
"source-map-loader": "^0.2.4", | ||
"standard": "^14.3.1", | ||
"ts-jest": "^25.0.0", | ||
"ts-loader": "^6.2.1", | ||
"tslint": "^5.20.1", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-eslint-rules": "^5.4.0", | ||
"tslint-react": "^4.1.0", | ||
"tslint-sonarts": "^1.9.0", | ||
"typescript": "^3.7.3", | ||
"webpack": "^4.41.2", | ||
"webpack-cli": "^3.3.10", | ||
"source-map-loader": "^2.0.0", | ||
"standard": "^16.0.0", | ||
"ts-jest": "^26.0.0", | ||
"ts-loader": "^8.0.0", | ||
"typescript": "^4.2.0", | ||
"webpack": "^5.0.0", | ||
"webpack-cli": "^4.0.0", | ||
"webpack-dev-server": "^3.9.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^1.10.0", | ||
"tslib": "^2.1.0", | ||
"use-constant": "^1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "17.0.1", | ||
"rxjs": "^6.5.3" | ||
}, | ||
"lint-staged": { | ||
@@ -71,3 +79,3 @@ "*.js": [ | ||
"prettier --write", | ||
"tslint -c tslint.json --fix" | ||
"yarn lint:eslint" | ||
] | ||
@@ -87,3 +95,6 @@ }, | ||
} | ||
}, | ||
"jest": { | ||
"resolver": "browser-resolve" | ||
} | ||
} |
@@ -17,3 +17,3 @@ # React hooks for RxJS | ||
``` | ||
$ npm i --save rxjs-hooks | ||
$ npm i --save rxjs-hooks rxjs | ||
``` | ||
@@ -24,3 +24,3 @@ | ||
``` | ||
$ yarn add rxjs-hooks | ||
$ yarn add rxjs-hooks rxjs | ||
``` | ||
@@ -27,0 +27,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
37489
35
424
4
34
+ Addedobject-assign@4.1.1(transitive)
+ Addedreact@17.0.1(transitive)
+ Addedrxjs@6.6.7(transitive)
+ Addedtslib@2.8.1(transitive)
- Removedreact@18.3.1(transitive)
Updatedtslib@^2.1.0