Comparing version 2.1.0 to 2.2.0
@@ -12,4 +12,6 @@ import { IAction, IActionType, IChannel } from "./types"; | ||
put(action: IAction): void; | ||
put2(type: IActionType<void>): void; | ||
put2<T>(type: IActionType<T>, payload: T): void; | ||
on<T>(type: IActionType<T>, handler: (payload: T) => void): () => void; | ||
private drainDefer; | ||
} |
@@ -46,2 +46,5 @@ import { defer } from "./utils/defer"; | ||
} | ||
put2(type, payload) { | ||
this.put({ type, payload }); | ||
} | ||
on(type, handler) { | ||
@@ -48,0 +51,0 @@ let list = this.eventLists.get(type); |
@@ -7,5 +7,6 @@ export { Channel } from "./Channel"; | ||
export { createUseDispatch, useDispatch } from "./hooks/useDispatch"; | ||
export { useDispatch2 } from "./hooks/useDispatch2"; | ||
export { createUseSelector, useSelector } from "./hooks/useSelector"; | ||
export { Provider } from "./Provider"; | ||
export { Store } from "./Store"; | ||
export { IAction, IActionType, IChannel, IStore } from "./types"; | ||
export { IAction, IActionType, IChannel, IDispatch2, IStore } from "./types"; |
@@ -7,4 +7,5 @@ export { Channel } from "./Channel"; | ||
export { createUseDispatch, useDispatch } from "./hooks/useDispatch"; | ||
export { useDispatch2 } from "./hooks/useDispatch2"; | ||
export { createUseSelector, useSelector } from "./hooks/useSelector"; | ||
export { Provider } from "./Provider"; | ||
export { Store } from "./Store"; |
@@ -45,2 +45,7 @@ /** | ||
/** | ||
* A shortcut for put(createAction(type, payload)). | ||
*/ | ||
put2(type: IActionType<void>): void; | ||
put2<T>(type: IActionType<T>, payload: T): void; | ||
/** | ||
* Listens for Actions of a given Type to enter the emitter, invoking the given callback | ||
@@ -96,1 +101,5 @@ * with the Action's payload. Returns a cleanup function that, when called, will stop | ||
} | ||
export interface IDispatch2 { | ||
(type: IActionType<void>): void; | ||
<T>(type: IActionType<T>, payload: T): void; | ||
} |
@@ -49,2 +49,5 @@ "use strict"; | ||
} | ||
put2(type, payload) { | ||
this.put({ type, payload }); | ||
} | ||
on(type, handler) { | ||
@@ -51,0 +54,0 @@ let list = this.eventLists.get(type); |
@@ -16,2 +16,4 @@ "use strict"; | ||
Object.defineProperty(exports, "useDispatch", { enumerable: true, get: function () { return useDispatch_1.useDispatch; } }); | ||
var useDispatch2_1 = require("./hooks/useDispatch2"); | ||
Object.defineProperty(exports, "useDispatch2", { enumerable: true, get: function () { return useDispatch2_1.useDispatch2; } }); | ||
var useSelector_1 = require("./hooks/useSelector"); | ||
@@ -18,0 +20,0 @@ Object.defineProperty(exports, "createUseSelector", { enumerable: true, get: function () { return useSelector_1.createUseSelector; } }); |
{ | ||
"name": "tinysaga", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "module": "esm/index.js", |
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
38312
50
904