$
This commit is contained in:
15
node_modules/riot/esm/core/compute-component-state.js
generated
vendored
Normal file
15
node_modules/riot/esm/core/compute-component-state.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { callOrAssign } from '@riotjs/util';
|
||||
|
||||
/**
|
||||
* Compute the component current state merging it with its previous state
|
||||
* @param {Object} oldState - previous state object
|
||||
* @param {Object} newState - new state given to the `update` call
|
||||
* @returns {Object} new object state
|
||||
*/
|
||||
|
||||
function computeComponentState(oldState, newState) {
|
||||
return Object.assign({}, oldState, callOrAssign(newState));
|
||||
}
|
||||
|
||||
export { computeComponentState };
|
Reference in New Issue
Block a user