parcoursup/node_modules/riot/esm/core/compute-component-state.js
lalBi94 7bc56c09b5 $
2023-03-05 13:23:23 +01:00

16 lines
471 B
JavaScript

/* 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 };