@rbxts/covenant 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/covenant",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "main": "src/init.luau",
5
5
  "scripts": {
6
6
  "build": "rbxtsc",
package/src/covenant.d.ts CHANGED
@@ -69,7 +69,7 @@ export declare class Covenant {
69
69
  defineIdentity<T extends defined>({ identityComponent, replicated, lifetime, factory, }: {
70
70
  identityComponent: Entity<T>;
71
71
  replicated: boolean;
72
- lifetime: (entity: Entity, state: T, despawn: () => void) => (() => void);
72
+ lifetime: (entity: Entity, state: T, despawn: () => void) => (() => void) | undefined;
73
73
  factory: (spawnEntity: (state: T) => void) => void;
74
74
  }): void;
75
75
  private worldEntity;
package/src/covenant.luau CHANGED
@@ -681,7 +681,9 @@ do
681
681
  local cleanup = function() end
682
682
  cleanup = lifetime(entity, state, function()
683
683
  self:worldDelete(entity)
684
- cleanup()
684
+ if cleanup ~= nil then
685
+ cleanup()
686
+ end
685
687
  end)
686
688
  end)
687
689
  end