Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rbxts/reflex-class

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rbxts/reflex-class - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

60

out/source/custom-broadcaster/broadcaster.d.ts

@@ -1,3 +0,58 @@

import { BroadcasterOptions, ProducerMap, ProducerMiddleware } from "@rbxts/reflex";
export declare const CreatePatchBroadcaster: <P extends ProducerMap>(options: BroadcasterOptions<P>) => {
/// <reference types="@rbxts/types" />
/// <reference types="@rbxts/compiler-types" />
import { BroadcastAction, Producer, ProducerMiddleware } from "@rbxts/reflex";
interface PatchBroadcasterOptions<S extends object> {
/**
* The map of producers to broadcast.
*/
readonly producer: Producer<S>;
/**
* The rate at which the server should hydrate the clients
* with the latest state. If this is set to `-1`, the server
* will not hydrate the clients.
* @default 60
*/
readonly hydrateRate?: number;
/**
* The rate at which the server should broadcast actions to
* the clients. If this is set to `0`, actions are broadcast
* with the next server heartbeat.
* @default 0
*/
readonly dispatchRate?: number;
/**
* Runs before actions are dispatched to a player. Can be used to
* filter actions or manipulate them before sending.
*
* Return `undefined` to not share the action with this player.
*/
readonly beforeDispatch?: (player: Player, action: BroadcastAction) => BroadcastAction | undefined;
/**
* Runs before the client is hydrated with the latest state. Can be
* used to filter the state or hide certain values from the client.
*
* **Note:** Do not mutate the state in this function! Treat it as a
* read-only object, and return a new object if you need to change it.
*/
readonly beforeHydrate?: (player: Player, state: S) => Partial<S>;
/**
* A function that broadcasts actions to the given player.
* @param player The player to broadcast to.
* @param actions The actions to broadcast.
*/
readonly dispatch: (player: Player, actions: BroadcastAction[]) => void;
/**
* An optional custom hydration function. If provided, this function
* will be called instead of being implicitly handled in 'dispatch'.
* Useful for reducing load on a single remote if your state is large.
*
* **Note:** If defined, the client should call `receiver.hydrate` to
* hydrate the state.
*
* @param player The player to hydrate.
* @param state The state to hydrate the player with.
*/
readonly hydrate?: (player: Player, state: S) => void;
}
export declare const CreatePatchBroadcaster: <S extends object>(options: PatchBroadcasterOptions<S>) => {
flush: () => void;

@@ -8,1 +63,2 @@ start: (player: Player) => void;

};
export {};

2

package.json
{
"name": "@rbxts/reflex-class",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "out/init.lua",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc