open-index/open-npm huggingface dataset:
npm package: @rbxts/rodux-effects
Description: Lightweight side-effect library for Rodux
Author: littensy
Latest version: 1.0.7

# ✨ rodux-effects

An experimental side-effect library for Rodux. It allows running side effects when a selector updates or an action dispatches.

Rodux-effects is designed to simplify interactions within game state where UI is not applicable, like the server.

## 🔌 Installation and Setup

You need to first install [Rodux](https://www.npmjs.com/package/@rbxts/rodux) and add the rodux-effects package:

```bash
npm install @rbxts/rodux-effects

yarn add @rbxts/rodux-effects

pnpm add @rbxts/rodux-effects
```

If your game's state falls under one Rodux store, you can use `bind(store)` to load it into rodux-effects.

The `effectMiddleware` value is optional, but it's required to use side effects with actions.

```ts
import Rodux from "@rbxts/rodux";
import { bind, effectMiddleware } from "@rbxts/rodux-effects";
import rootReducer from "reducers";

const store = new Rodux.Store(rootReducer, undefined, [effectMiddleware]);

bind(store);
```

## 📚 Usage

See the [example](https://github.com/littensy/rodux-effects/tree/master/example) for detailed usage.

Running a side effect for a selector update is straightforward:

```ts
import { onUpdate } from "@rbxts/rodux-effects";
import { selectCounter } from "reducers/counter";

onUpdate(selectCounter, (counter, prevCounter) => {
	print(`Counter changed to ${counter} (${counter - prevCounter})`);
});
```

You can also run an effect for a specific action dispatch:

```ts
import { onDispatch } from "@rbxts/rodux-effects";
import { RootAction } from "reducers";

onDispatch<RootAction>("CLEAR", () => {
	print("Counter cleared");
});

// The second generic is a shortcut for extracting the type of the action.

onDispatch<RootAction, "INCREMENT">("INCREMENT", (action) => {
	print(`Incremented by ${action.amount}`);
});
```

More complex interactions with the store are also possible.

```ts
import { dispatch, getState, onUpdate } from "@rbxts/rodux-effects";
import { setPlayers, selectPlayers } from "reducers/players";
import { selectRoundStatus } from "reducers/round";

function onRoundStart() {
	const players = game.GetService("Players").GetPlayers();
	
	for (const player of players) {
		task.defer(() => player.LoadCharacter());
	}
	
	dispatch(setPlayers(players));
}

function onRoundEnd() {
	const playersLeft = getState(selectPlayers);
	
	for (const player of playersLeft) {
		print(`Player ${player.name} wins!`);
		
		task.defer(() => player.LoadCharacter());
	}
	
	dispatch(setPlayers([]));
}

onUpdate(selectRoundStatus, (roundStatus) => {
	if (roundStatus === "started") {
		onRoundStart();
	} else if (roundStatus === "ended") {
		onRoundEnd();
	}
});
```

```ts
import { dispatch, getState, waitForUpdate } from "@rbxts/rodux-effects";
import { makeSelectPlayerData } from "reducers/player-data";

function getPlayerData(player: Player) {
	const selectPlayerData = makeSelectPlayerData(player.UserId);
	const playerData = getState(selectPlayerData);
	return playerData ? Promise.resolve(playerData) : waitForUpdate(selectPlayerData);
}
```
npm package: @rbxts/rodux-hooks
Description: Port of littensy's roact-rodux-hooked for kampf's RoactHooks library.
Author: howmanysmall
Latest version: 1.0.0

# rodux-hooks

Port of [littensy's roact-rodux-hooked](https://github.com/littensy/roact-rodux-hooked) for [kampf's RoactHooks](https://www.npmjs.com/package/@rbxts/roact-hooks) library.

```tsx
import Hooks from "@rbxts/roact-hooks";
import Roact from "@rbxts/roact";
import { useDispatch, useSelector } from "@rbxts/rodux-hooks";
import { Store, StoreState, increment } from "./store";

const Component: Hooks.FC<{}> = (_, hooks) => {
	const count = useSelector(hooks, (state: StoreState) => state.count);
	const dispatch = useDispatch<Store>(hooks);

	return (
		<textbutton
			Text={`Counter: ${count}`}
			BackgroundColor3={Color3.fromRGB(80, 120, 200)}
			Size={new UDim2(0.5, 0, 1, 0)}
			Event={{
				Activated: () => dispatch(increment()),
			}}
		/>
	);
};

export const Counter = new Hooks(Roact)(Component);
```

```tsx
import { Provider } from "@rbxts/rodux-hooks";
import Roact from "@rbxts/roact";
import { Provider, store } from "./store";

export const App = () => {
	return (
		<Provider store={store}>
			...
		</Provider>
	);
};
```
npm package: @rbxts/roduxutils
Description: Typings for SolarHorizon's Rodux-Utils module. https://solarhorizon.github.io/rodux-utils/api/RoduxUtils
Author: SolarHorizon
Latest version: 1.1.0

# RoduxUtils

Typings for SolarHorizon's Rodux-Utils module.

Docs: https://solarhorizon.github.io/rodux-utils/api/RoduxUtils
npm package: @rbxts/roman-numerals
Description: Utility functions for parsing and converting roman numerals
Author: Rimuy
Latest version: 1.0.2

# Roman numerals
### Light-weight utility functions that makes easier to work with roman numerals.

```js
import { parse, toNumeral } from "@rbxts/roman-numerals";

parse("LXIX"); // 69
toNumeral(3999); // "MMMCMXCIX"
```
npm package: @rbxts/rowindcss
Description: TailwindCSS classes for Roact & Roblox-ts.
Author: Yahya
Latest version: 1.3.1

# RowindCSS
TailwindCSS classes for Roact & Roblox-ts.

## Getting Started
Install using:
```bash
yarn add @rbxts/rowindcss
```
or
```bash
npm i @rbxts/rowindcss
```

Install Tailwind configs in your project root for autocomplete
```bash
npx tailwindcss init
```

```js
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./src/**/*.tsx",
    "./src/**/**/*.tsx",
    "./src/**/**/**/*.tsx"
],
  theme: {
    extend: {},
  },
  plugins: [],
}
```

Import the available Rowind components and start using them in Roact with Tailwind classes.
```tsx
    import { Div, Button, Text } from '@rbxts/rowindcss'

    export const Test = () => {
        return (
            <Div className="w-full h-48 p-10 border-4 overflow-y border-red-700 border-opacity-50 flex justify-center items-end gap-3 top-2/4 left-2/4 rounded-xl bg-blue-500">
                <Div className="w-10 h-10 rounded-sm"/>
                <Div className="w-10 h-10 rounded-lg bg-yellow-300"/>
                <Div className="w-10 h-10 bg-green-700"/>
                <Button Event={{
                  MouseButton1Click: () => {
                    print("clicked")
                  }
                }}
                Text="X" className="w-10 h-10 rounded-full bg-red-700"/>
                <Text Text="Y" className="w-10 h-10 rounded-full bg-purple-800"/>
            </Div>
        )
    }
```

Refer to the tailwind documentation for class names.
https://tailwindcss.com/

Currently supported Tailwind classes:
- Flex (align-items, justify-content, gap, flex-direction)
- Background (colour)
- Border (size, colour, transparency, radius)
- Font (weight)
- Positioning (Left, Top, Right, Bottom)
- Origin (anchor point)
- Padding
- Text (size, colour)
- Size (width, height)
- Aspect Ratio
Experimental:
- Overflow (overflow-x, overflow-y)

## FAQ
How to attach references?
You can use the 'ref' property of any Rowind component.
```
<Button ref={yourRef}/>
```
npm package: @rbxts/sapphire-ecr
Description: A lightweight ECR scheduler for sapphire
Author: Mark-Marks
Latest version: 0.1.0-ts.1

# sapphire-ecr
A lightweight scheduler + niceties (replication, etc.) for [centau/ecr](https://github.com/centau/ecr) for [Mark-Marks/sapphire](https://github.com/Mark-Marks/sapphire)

# TODO
- [x] Write scheduler
- [ ] Add replication -- waiting for `sapphire-net`

# Installation
1. Install it with wally
- ```toml
[dependencies]
sapphire_ecr = "mark-marks/sapphire-ecr@LATEST" # replace LATEST with the latest version
```
- `wally install`
2. Extend sapphire with it
```luau
local sapphire_ecr = require("@packages/sapphire_ecr")

sapphire
    :use(sapphire_ecr)
```

# API

## Types

### LoopType
```luau
type LoopType = "Stepped" | "Heartbeat" | "RenderStepped"
```

### System
```luau
type System = {
    --- Fires every `RunService.Stepped`
    runner: (delta_time: number) -> (),
    --- 1 = lowest priority
    priority: number?,
    --- Defaults to "Stepped"
    loop_type: LoopType?,
}
```

### singleton
```luau
export type singleton = sapphire.singleton & {
    system: (registry: ecr.Registry) -> (delta_time: number) -> (),
    priority: number?,
    loop_type: LoopType?,
}
```

### Spawner<T...>
```luau
export type Spawner<T...> = {
    --- Creates an entity with the given components.
    --- @param ... T...
    --- @return ecr.entity
    spawn: (T...) -> ecr.entity,
    --- Creates an entity with the given components and returns a handle to it.
    --- @param ... T...
    --- @return ecr.Handle
    spawn_with_handle: (T...) -> ecr.Handle,
}
```

## Registered methods

### singleton.system()
```luau
(
    singleton: sapphire.Singleton & { system: (registry: ecr.Registry) -> (delta_time:number) -> () }
) -> void
```
```luau
function singleton.system(registry: ecr.Registry)
    return function(delta_time: number)
        -- loop code
    end
end
```

## Functions

### .create_spawner
```luau
<T...>(
    ...: T...
) -> Spawner<T...>
```

### .spawn_entity
```luau
() -> ecr.entity
```

### .spawn_entity_with_handle
```luau
() -> ecr.Handle
```
npm package: @rbxts/sapphire-net
Description: An optimized networking library for sapphire
Author: Mark-Marks
Latest version: 0.1.0-ts.1

# sapphire-net
A networking library for [Mark-Marks/sapphire](https://github.com/Mark-Marks/sapphire).

Utilizes [Data-Oriented-House/Squash](https://github.com/Data-Oriented-House/Squash) for buffer serdes.

Features both defined and undefined events:
```luau
-- shared/events.luau
local t = net.data_types
return net.define_namespace("namespace_name", function()
    return {
        event_name = net.defined({
            -- `value` can be any type, but it's a struct for demonstration purposes
            value = t.struct({
                a = t.string(),
                b = t.uint(2), -- in bytes
            }),
        }),
        -- etc.
    }
end)
```
```luau
-- singletons/singleton.luau
-- Dynamically serializes and deserializes data into a buffer.
-- A bit less performant and way less bandwidth efficient (but still more than regularly sending data)
-- because the information of what type and what length something is needs to be stored.
local undefined_event: net.event<{ name: string, age: number }> = net.undefined("event_name", "reliable")
```

# Benchmarks:
WIP
npm package: @rbxts/scheduler-internal
Description: This is a package for cooperative scheduling in a Lua environment. It is currently used internally by React, but we plan to make it more generic.
Author: jsdotlua
Latest version: 0.2.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `scheduler`

This is a package for cooperative scheduling in a Lua environment. It is currently used internally by React, but we plan to make it more generic.

The public API for this package is not yet finalized.
npm package: @rbxts/semver
Description: Implementation of [semver.lua](https://github.com/kikito/semver.lua) in `roblox-ts`.
Author: LetterN
Latest version: 1.0.0

# @rbxts/semver

Implementation of [semver.lua](https://github.com/kikito/semver.lua) in `roblox-ts`.

## Usage

```ts
import { SemVer as semver } from "@rbxts/semver";

// two ways of creating it: with separate parameters, or with one string
const v1 = new semver(1, 0, 0);
const v2_5_1 = new semver("2.5.1")

// major, minor and patch attributes
v2_5_1.major // 2
v2_5_1.minor // 5
v2_5_1.patch // 1

// prereleases:
const a = new semver(1,0,0,'alpha');
a.prerelease // 'alpha'
const b = new semver('1.0.0-beta');
b.prerelease // 'beta'

// builds
const c = new semver(1,0,0, undefined,'build-1')
c.build // 'build-1'

const d = new semver('0.9.5+no.extensions.22')
d.build // 'no.extensions.22'

// comparison & sorting
new semver('1.2.3').equals(new semver(1,2,3))             // true
new semver('1.2.3').lessThan(new semver(4,5,6))           // true
new semver('1.2.3-alpha').lessThan(new semver('1.2.3'))   // true
new semver('1.2.3').lessThan(new semver('1.2.3+build.1')) // false, builds are ignored when comparing versions in semver

// "pessimistic upgrade" operator: ^
// a ^ b returns true if it's safe to update from a to b
new semver('2.0.1').upgrade(new semver('2.5.1')) // true - it's safe to upgrade from 2.0.1 to 2.5.1
new semver('1.0.0').upgrade(new semver('2.0.0')) // false - 2.0.0 is not supposed to be backwards-compatible
new semver('2.5.1').upgrade(new semver('2.0.1')) // false - 2.5.1 is more modern than 2.0.1.

// getting newer versions
new semver(1,0,0).nextPatch() // v1.0.1
new semver(1,2,3).nextMinor() // v1.3.0 . Notice the patch resets to 0
new semver(1,2,3).nextMajor() // v2.0.0 . Minor and patch are reset to 0
```