@rbxts/app-forge 0.3.7 → 0.3.9

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.
@@ -31,6 +31,10 @@ do
31
31
  if not (name ~= "" and name) then
32
32
  error("App name is required in Args constructor")
33
33
  end
34
+ local bind = forge:getBind(name)
35
+ if not bind then
36
+ error("FAILED TO GET BIND FOR APP!")
37
+ end
34
38
  local px = usePx(target)
35
39
  self.forge = forge
36
40
  local _object = table.clone(props.props)
@@ -38,7 +42,7 @@ do
38
42
  _object.px = px
39
43
  self.props = _object
40
44
  self.name = name
41
- self.bind = forge:getBind(name)
45
+ self.bind = bind
42
46
  self.state = self.bind:getValue()
43
47
  end
44
48
  end
package/out/index.d.ts CHANGED
@@ -5,8 +5,8 @@ export default class AppForge {
5
5
  binds: Map<string, [React.Binding<boolean>, (T: boolean) => void]>;
6
6
  loaded: Map<string, React.Element<any, string | React.JSXElementConstructor<any>>>;
7
7
  private rulesManager;
8
- getBind(name: AppNames[number]): React.Binding<boolean>;
9
- getState(name: AppNames[number]): boolean;
8
+ getBind(name: AppNames[number]): void | React.Binding<boolean>;
9
+ getState(name: AppNames[number]): boolean | undefined;
10
10
  set(name: AppNames[number], value: boolean): void;
11
11
  open(name: AppNames[number]): void;
12
12
  close(name: AppNames[number]): void;
package/out/init.luau CHANGED
@@ -33,14 +33,18 @@ do
33
33
  local _binds = self.binds
34
34
  local _name = name
35
35
  if not (_binds[_name] ~= nil) then
36
- error(`App "{name}" has no binding`)
36
+ return warn(`App "{name}" has no binding`)
37
37
  end
38
38
  local _binds_1 = self.binds
39
39
  local _name_1 = name
40
40
  return _binds_1[_name_1][1]
41
41
  end
42
42
  function AppForge:getState(name)
43
- return self:getBind(name):getValue()
43
+ local _result = self:getBind(name)
44
+ if _result ~= nil then
45
+ _result = _result:getValue()
46
+ end
47
+ return _result
44
48
  end
45
49
  function AppForge:set(name, value)
46
50
  if not self.rulesManager:applyRules(name, value) then
@@ -52,7 +56,7 @@ do
52
56
  local _ = _binding[1]
53
57
  local setBinding = _binding[2]
54
58
  if not setBinding then
55
- error(`App "{name}" has no binding setter`)
59
+ return warn(`App "{name}" has no binding setter`)
56
60
  end
57
61
  setBinding(value)
58
62
  end
package/out/rules.luau CHANGED
@@ -49,13 +49,7 @@ do
49
49
  local allNames = Object.keys(AppRegistry)
50
50
  -- ▼ ReadonlyArray.forEach ▼
51
51
  local _callback = function(n)
52
- local _condition = not (n ~= "" and n) or n == name
53
- if not _condition then
54
- local _loaded = self.appManager.loaded
55
- local _n = n
56
- _condition = _loaded[_n]
57
- end
58
- if _condition then
52
+ if not (n ~= "" and n) or n == name then
59
53
  return nil
60
54
  end
61
55
  local _n = n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/app-forge",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "An App Manager for react",
5
5
  "main": "out/init.lua",
6
6
  "packageManager": "bun@1.3.1",