Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLUID-6158: Document fluid.modelPairToChanges() #122

Merged
merged 4 commits into from Nov 7, 2017

Conversation

Projects
None yet
2 participants
@simonbates
Copy link
Member

commented Jun 12, 2017

Add documentation for fluid.modelPairToChanges().

Code pull request: fluid-project/infusion#830

* `value {Any}` Model value to compare
* `oldValue {Any}` Model value to compare
* `changePathPrefix {String|Array of String}` [optional] Path prefix to prepend to change record paths
* Returns: `{Array of Object}` An array of change records

This comment has been minimized.

Copy link
@amb26

amb26 Aug 3, 2017

Member

This type should really read {Array of changeRecord} and link to the section in ChangeApplierAPI which defines it.

This comment has been minimized.

Copy link
@simonbates

simonbates Aug 9, 2017

Author Member

I think I was incorrect in referring to the output as "change records". Looking at the ChangeApplierAPI docs, I think they are changeRequest objects, because I output "path" properties rather than "changePath" properties. Does this seem right?

I've updated the docs to read "changeRequest" and added a link to the docs for it.

This comment has been minimized.

Copy link
@amb26

amb26 Aug 10, 2017

Member

Yes, this is brilliant, thanks!

and returns an array of change records. The optional argument
`changePathPrefix` is prepended to the change path of each record (this
is useful for generating change records to be applied at a non-root path
in a model).

This comment has been minimized.

Copy link
@amb26

amb26 Aug 3, 2017

Member

It would be really useful to have a super-simple example here that might allow people to get a sense of what is going on - for example, a computation of the changes between {a: 1} and {b:2}

This comment has been minimized.

Copy link
@simonbates

simonbates Aug 9, 2017

Author Member

Great suggestion. Done.

This comment has been minimized.

Copy link
@amb26

amb26 Aug 10, 2017

Member

Great example, very clear

in a model).
The returned array of change records may be used with
`fluid.fireChanges()`.

This comment has been minimized.

Copy link
@amb26

amb26 Aug 3, 2017

Member

This API isn't actually documented - I wonder if I could prevail on you to add some basic docs for it in ChangeApplierAPI.md at the end of the section "Programmatic style for triggering a change" and then link to it here - cheers!

This comment has been minimized.

Copy link
@amb26

amb26 Aug 10, 2017

Member

I think this comment got displaced through collateral changes - do you think it seems doable?

This comment has been minimized.

Copy link
@simonbates

simonbates Aug 10, 2017

Author Member

Yes, absolutely. I will add docs for fluid.fireChanges.

This comment has been minimized.

Copy link
@simonbates

simonbates Aug 11, 2017

Author Member

Done.

simonbates added some commits Aug 9, 2017

FLUID-6158: Use "changeRequest" rather than "change record"
And address review comments:

- Link to the documentation for changeRequest
- Add an example

@amb26 amb26 merged commit 211eed5 into fluid-project:master Nov 7, 2017

1 check passed

security/snyk No new vulnerabilities
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.