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

Adding example to OptionsMerging #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sgithens
Copy link

No description provided.

@@ -70,3 +70,23 @@ fluid.merge(policy, target, source-1, ... source-n);
```

where `policy` is the _merge policy object_ (may be empty), `target` is the object to (destructively) be the target of the merge operation, and `source-1` through `source-n` are a list of a number of "source" options structure from which the merge is to be performed.

## Examples ##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgithens, thanks for adding this example! The arrayConcatPolicy is not yet explained in the table of policy values above. Would you be willing to add a row to the table with a brief description?

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jobara
Copy link
Member

jobara commented Jun 11, 2020

@amb26 and @sgithens is this something that should still be added to the docs?

@amb26
Copy link
Member

amb26 commented Jun 11, 2020

Well, users are no longer recommended to use fluid.merge() as a standalone function - this is warned halfway down the document. I see we still barely support it, with a couple of dangerous-looking examples in the prefs framework. If we did anything, it would be best to restructure this page to more clearly focus on mergePolicies - which are also something that we don't direct "everyday" users of the framework (if there are any such people) to get involved with, but unfortunately with the current state of the framework most users end up having to meddle with them somewhat once their app gets beyond a certain level of sophistication.

All of this said, the example is basically helpful in that it shows something concrete happening which otherwise might be quite mystifying. We might consider accepting the update someday if any time emerged to polish it up a bit : P

Note that in the "new" framework virtually everything sensitive (members, models, etc.) gets sent into the general "fluid.deferringMergePolicy" since it has become accepted that the action of the generic mergePolicy is faulty because of issues such as https://issues.fluidproject.org/browse/FLUID-6219

@jobara jobara changed the base branch from master to main October 22, 2020 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants