Array.prototype.map() expects a return value from arrow function
pmartiamarista opened this issue · comments
hooks.map((hook) => {
if (typeof hook !== "function") {
throw new TypeError(
Provided global hook value "${hook}" is not a function.
);
}
hooks.map((hook) => {
stores[hook] = useGlobalHook(hook);
});
Hi, .map needs a return value. you can use forEach() to iterate de Array. Very useful Hook by the way. I change the example with useReducer
const [state, dispatch] = useReducer(countReducer, {
...initialState,
});
Works great!
@pmartiamarista Oh yeah, I will do that ASAP and thank you for checking out the library.