@rbxts/reflex-class
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,1 +0,4 @@ | ||
export {}; | ||
export * from "./source/class-producer"; | ||
export * from "./source/decorators"; | ||
export * from "./source/custom-broadcaster/broadcaster"; | ||
export * from "./source/custom-broadcaster/broadcast-receiver"; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="@rbxts/compiler-types" /> | ||
import { Janitor } from "@rbxts/janitor"; | ||
@@ -8,7 +7,8 @@ import { Producer } from "@rbxts/reflex"; | ||
protected producer: Producer<S>; | ||
private subscribers; | ||
private __janitor; | ||
constructor(); | ||
GetState(): S; | ||
Subscribe(...args: Parameters<Producer["subscribe"]>): () => void; | ||
Subscribe(listener: (state: S, previousState: S) => void): () => void; | ||
Subscribe<T>(selector: (state: S) => T, listener: (state: T, previousState: T) => void): () => void; | ||
Subscribe<T>(selector: (state: S) => T, predicate: ((state: T, previousState: T) => boolean) | undefined, listener: (state: T, previousState: T) => void): () => void; | ||
Dispatch(newState: S): S; | ||
@@ -21,6 +21,4 @@ /** @internal */ | ||
/** @internal */ | ||
subscribeToInitProducer(subscriber: (producer: Producer<S>) => void): () => void; | ||
/** @internal */ | ||
private subscribeToInitialState; | ||
Destroy(): void; | ||
} |
import { ClassProducer, InferClassProducerState } from "../class-producer"; | ||
export declare const Subscribe: <T extends ClassProducer<object>, R>(selector: (state: InferClassProducerState<T>) => R, predicate?: ((state: R, previousState: R) => boolean) | undefined) => (target: T, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: T, state?: R | undefined, previousState?: R | undefined) => void>) => void; | ||
export declare const Subscribe: <T extends ClassProducer<InferClassProducerState<T>>, R>(selector: (state: InferClassProducerState<T>) => R, predicate?: ((state: R, previousState: R) => boolean) | undefined) => (target: T, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: T, state?: R | undefined, previousState?: R | undefined) => void>) => void; |
{ | ||
"name": "@rbxts/reflex-class", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -10,3 +10,4 @@ "main": "out/init.lua", | ||
"test:watch": "rbxtsc -w --type=game -p test -i test/include", | ||
"serve": "rojo serve test/default.project.json" | ||
"serve": "rojo serve test/default.project.json", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -13,0 +14,0 @@ "keywords": [], |
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
17191
25
70