mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
fix: set strict flags if RunService.IsStudio is true
This commit is contained in:
parent
573533058f
commit
d09fb5536b
4 changed files with 10 additions and 10 deletions
4
packages/charm/src/index.d.ts
vendored
4
packages/charm/src/index.d.ts
vendored
|
|
@ -50,12 +50,12 @@ export const flags: {
|
|||
/**
|
||||
* Enforces synchronous, non-yielding behavior in signals and effects.
|
||||
* Also enables state validation in Charm Sync to catch sync errors early.
|
||||
* Enabled if the optimization level is below 2, which is true in studio.
|
||||
* Enabled by default in Roblox Studio.
|
||||
*/
|
||||
strict: boolean;
|
||||
/**
|
||||
* Enforces immutability of tables by deep-freezing table values. Enabled
|
||||
* if the optimization level is below 2, which is true in studio.
|
||||
* by default in Roblox Studio.
|
||||
*/
|
||||
frozen: boolean;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -68,22 +68,22 @@ local batchDepth = 0
|
|||
-- Dependencies accessed during this time will link to the active subscriber.
|
||||
local activeSub: ReactiveNode?
|
||||
|
||||
local function isO2(): boolean
|
||||
return debug.info(1, "n") ~= "isO2"
|
||||
local function isStudio(): boolean
|
||||
return game ~= nil and game:GetService("RunService"):IsStudio()
|
||||
end
|
||||
|
||||
local flags = {
|
||||
--[[
|
||||
Enforces synchronous, non-yielding behavior in signals and effects.
|
||||
Also enables state validation in Charm Sync to catch sync errors early.
|
||||
Enabled if the optimization level is below 2, which is true in studio.
|
||||
Enabled by default in Roblox Studio.
|
||||
]]
|
||||
strict = not isO2(),
|
||||
strict = isStudio(),
|
||||
--[[
|
||||
Enforces immutability of tables by deep-freezing table values. Enabled
|
||||
if the optimization level is below 2, which is true in studio.
|
||||
by default in Roblox Studio.
|
||||
]]
|
||||
frozen = not isO2(),
|
||||
frozen = isStudio(),
|
||||
--[[
|
||||
Whether parent effects should track inner effects and clean them up
|
||||
when the parent effect re-runs. This is usually desirable, but can be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue