FLUID-6158: Extract setModel and applyModelChanges functions from NexusWebSocketBoundComponent to general Infusion usage

Metadata

Source
FLUID-6158
Type
Improvement
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Simon Bates
Reporter
Alan Harnum
Created
2017-05-17T14:44:35.319-0400
Updated
2018-02-16T13:37:08.646-0500
Versions
N/A
Fixed Versions
N/A
Component
  1. Data Binder

Description

It has been identified that the NexusWebSocketBoundComponent has some useful functionality that should be extracted into Infusion core.

The relevant functions are at https://github.com/simonbates/nexus-client/blob/master/src/NexusWebSocketBoundComponent.js#L144-L193 - their moral purpose is to calculate the changes necessary to bring one model into consistency with another model.

Signature and function name of the extracted functionality will be as follows:

fluid.modelPairToChanges(value, oldValue, path) -> [Array of ChangeRequest]

The return value can then be passed to fluid.fireChanges or otherwise used.

Comments