Skip to content

Instantly share code, notes, and snippets.

View sasial-dev's full-sized avatar

Sasial sasial-dev

View GitHub Profile
@sasial-dev
sasial-dev / header-footer-parallax-effect.markdown
Created March 30, 2019 02:43
Header/Footer Parallax Effect
@sasial-dev
sasial-dev / useReactHandle.ts
Last active September 29, 2024 00:59
React + Matter
// Under the MIT
import { useHookState } from "@rbxts/matter";
import { createElement as e } from "@rbxts/react";
import type { Root } from "@rbxts/react-roblox";
import { mount } from "shared/gui";
interface HandleState {
props: object;
handle?: Root;
}
@sasial-dev
sasial-dev / multiplayer.ts
Last active November 11, 2024 02:04
Reflex Multiplayer
// Under the MIT
import type { Producer, InferState, InferActions } from "@rbxts/reflex";
import { createProducer } from "@rbxts/reflex";
import { Dictionary as Object } from "@rbxts/sift";
// from reflex!
type ReplaceStateParameters<State, Actions> = {
readonly [K in keyof Actions]: Actions[K] extends (state: any, ...args: infer Args) => any
? (state: State, player: Player, ...args: Args) => State
: never;
import React, { useEffect, useState } from "@rbxts/react";
import { useSelector } from "@rbxts/react-reflex";
interface RouteProps extends React.PropsWithChildren {
path?: string;
visible?: boolean;
mount?: () => Promise<void>;
unmount?: () => Promise<void>;
}