what-core 0.5.6 → 0.6.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/dist/h.js CHANGED
@@ -1,4 +1,4 @@
1
- const EMPTY_OBJ = {};
1
+ const EMPTY_OBJ = Object.create(null);
2
2
  const EMPTY_ARR = [];
3
3
  export function h(tag, props, ...children) {
4
4
  props = props || EMPTY_OBJ;
package/dist/hooks.js CHANGED
@@ -123,6 +123,10 @@ ctx._contextSignals.get(context).set(value);
123
123
  }
124
124
  return children;
125
125
  },
126
+ Consumer: ({ children }) => {
127
+ const value = useContext(context);
128
+ return typeof children === 'function' ? children(value) : children;
129
+ },
126
130
  };
127
131
  return context;
128
132
  }