inertia-sails 0.0.5 → 0.0.6

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": "inertia-sails",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "The Sails adapter for Inertia.",
5
5
  "main": "index.js",
6
6
  "sails": {
@@ -1,12 +1,15 @@
1
1
  // Implement lazy data evaluation
2
+ // Userland can pass functions that returns a value becuase of this algorithm
3
+ // However do note to make all async operations outside the render() method in userland
2
4
  module.exports = function (allProps, dataKeys = []) {
3
5
  let props = {}
4
6
  for (const key of dataKeys) {
5
- if (typeof props[key] === 'function') {
7
+ if (typeof allProps[key] === 'function') {
6
8
  props[key] = allProps[key]()
7
9
  } else {
8
10
  props[key] = allProps[key]
9
11
  }
10
12
  }
13
+
11
14
  return props
12
15
  }