@dazn/kopytko-framework 1.0.6 → 1.1.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.1.0](https://github.com/getndazn/kopytko-framework/compare/v1.0.6...v1.1.0) (2022-05-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * added enqueueUpdate function to reduce number of rerenders ([#28](https://github.com/getndazn/kopytko-framework/issues/28)) ([4c80273](https://github.com/getndazn/kopytko-framework/commit/4c80273af7c20ded4bc41cdb94647142b209695f))
7
+
1
8
  ## [1.0.6](https://github.com/getndazn/kopytko-framework/compare/v1.0.5...v1.0.6) (2022-05-20)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazn/kopytko-framework",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "A modern Roku's Brightscript framework",
5
5
  "keywords": [
6
6
  "brightscript",
@@ -82,6 +82,10 @@ sub forceUpdate()
82
82
  m._kopytkoUpdater.forceStateUpdate()
83
83
  end sub
84
84
 
85
+ sub enqueueUpdate()
86
+ m._kopytkoUpdater.enqueueStateUpdate()
87
+ end sub
88
+
85
89
  sub updateProps(props = {} as Object)
86
90
  m.top.update(props)
87
91
  _updateDOM()
@@ -10,7 +10,7 @@ function KopytkoUpdater(baseStateUpdatedCallback as Function)
10
10
 
11
11
  ' State update callbacks are asynchronous to prevent multiple unnecessary rerenders
12
12
  ' when setState is called more than once in a function
13
- prototype.enqueueStateUpdate = sub (partialState as Object, callback = Invalid as Dynamic)
13
+ prototype.enqueueStateUpdate = sub (partialState = {} as Object, callback = Invalid as Dynamic)
14
14
  m._appendPartialState(partialState)
15
15
  if (NOT m._isMounted()) then return
16
16