1.0.0 • Published 5 years ago
hook-factory v1.0.0
🏭 Hook Factory
📕 Index
💪 Installing
yarn add hook-factor
📒 Usage
import Factory from "hook-factory";
const data = {
count: 0
};
const modifier = ({
prehook: data => {
data.count++
return data;
},
posthook: data => {
data.count++
return data;
}
});
const modifiers = [modifier];
const newCount = factory({
data,
modifiers
});
console.log(newCount);
// { count: 2}
1.0.0
5 years ago