object-assign-async
v1.0.0
Published
Object.assign asynchronously.
Downloads
2
Maintainers
Readme
object-assign-async
Use
Object.assign
asynchronously.
const assign = require('object-assign-async');
const upperCaseNameAsync = (state, next) => {
next(null, { name:state.name.toUpperCase() });
};
const addVersionNumber = (state, next) => {
setTimeout(λ => {
next(null, { version:'1.0.0' });
}, 10);
};
assign({ name:'object-assign-async' }, [upperCaseNameAsync, addVersionNumber], (err, result) => {
console.log(result); // => { name:'OBJECT-ASSIGN-ASYNC' version:'1.0.0' }
});