refactor: remove recursive()

This commit is contained in:
littensy 2026-02-22 23:21:57 -08:00
parent 78dbaa476c
commit d741640d28
2 changed files with 0 additions and 37 deletions

View file

@ -272,21 +272,6 @@ export function observe<V, K extends Key>(
fn: (value: V, key: K) => Cleanup | void, fn: (value: V, key: K) => Cleanup | void,
): Cleanup; ): Cleanup;
/**
* Disables recursive checks for the current reactive node. Currently, only
* computed signals use recursion checks, as effects allow recursion.
*
* @example
* ```ts
* computed(() => {
* recursive();
* setCount(getCount() + 1);
* return getCount();
* })
* ```
*/
export function recursive(): void;
/** /**
* Creates a deep reactive value that tracks properties when they're accessed. * Creates a deep reactive value that tracks properties when they're accessed.
* Returns a proxy object that subscribes to changes on any nested property * Returns a proxy object that subscribes to changes on any nested property

View file

@ -876,27 +876,6 @@ local function subscribe<T>(getter: () -> T, fn: (state: T, lastState: T) -> ())
end) end)
end end
--[[
Disables recursive checks for the current reactive node. Currently, only
computed signals use recursion checks, as effects allow recursion.
@example
```luau
computed(function()
recursive()
setCount(getCount() + 1)
return getCount()
end)
```
]]
local function recursive()
if activeSub then
activeSub.flags = bit32.band(activeSub.flags, bit32.bnot(RECURSED_CHECK))
else
warn(debug.traceback("recursive() can only be called inside a reactive node.", 2))
end
end
--[[ --[[
Calls the callback function for each unique key in the table returned by the Calls the callback function for each unique key in the table returned by the
getter. The callback is called once for each key, and again when a new key getter. The callback is called once for each key, and again when a new key
@ -1185,7 +1164,6 @@ return {
batch = batch, batch = batch,
subscribe = subscribe, subscribe = subscribe,
listen = listen, listen = listen,
recursive = recursive,
observe = observe, observe = observe,
mapped = mapped :: (<KI, VI, KO, VO>( mapped = mapped :: (<KI, VI, KO, VO>(
getter: () -> { [KI]: VI }, getter: () -> { [KI]: VI },