parcoursup/node_modules/riot/esm/core/compute-component-state.js

16 lines
471 B
JavaScript
Raw Normal View History

2023-03-05 13:23:23 +01:00
/* 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 };