@rbxts/immut
Advanced tools
Comparing version 0.4.0-ts.0 to 0.4.0-ts.1
{ | ||
"name": "@rbxts/immut", | ||
"version": "0.4.0-ts.0", | ||
"version": "0.4.0-ts.1", | ||
"description": "A draft-based immutable data library based on Immer", | ||
@@ -5,0 +5,0 @@ "main": "src/init.lua", |
@@ -10,8 +10,7 @@ # Immut | ||
```ts | ||
import Immut, { None, produce } from "@rbxts/immut"; | ||
import Immut, { produce } from "@rbxts/immut"; | ||
let oldState: Array<string> | undefined; | ||
const oldState = ["foo"]; | ||
const newState = produce(oldState, (draft) => { | ||
if (!draft) return []; | ||
if (draft.includes("foo")) return None; | ||
@@ -18,0 +17,0 @@ // draft.push(), draft.insert(), draft.unshift() NOT allowed as they compile to table.insert, which is not draft-safe |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25405
35