feat(js-api): Provides FDS atom utilities and state interface through js-api#1265
Closed
antonio-ortega wants to merge 13 commits into
Closed
feat(js-api): Provides FDS atom utilities and state interface through js-api#1265antonio-ortega wants to merge 13 commits into
antonio-ortega wants to merge 13 commits into
Conversation
…voiding interact with the rest of the atom if it is not actually needed
…o expose one single function whose promise returns the main get, set and subscribe, so they can only be used once the promise has been resolved
…arch but also Filters
…ctions, so we can use subscribe as a wrap up function
…d when interacting with the atom, search or filter right now but might be others in the future, so it does not make sense to expose the whole getFDSAtom publicly
Member
Author
|
It follows here #1267 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is linked to LPD-86378 - Technical Task | Create a Custom Element Client Extension for the Data Set Search Bar. Including these changes and releasing a new js-api version is required in order to be able to merge the pull request for that LPD, but both must be reviewed together.
What’s New
subscribeSearchandsubscribeFiltersto interact with the atom. They just need to pass whichfdsNamethey want to subscribe to, and once the subscription promise is resolved, they'll get an API (get, set, dispose) as a result to work with it.getFDSAtom, because it is needed internally, but it should not be needed externally. We don't want them to manipulate the whole atom, just their slice.Dev Highlights
js-apihave been used to provide some useful types for developers. Now, we had a bit of a different case because we want to offer some functionality rather than just some types, we are providing some API so external developers could get a slice of an atom just by the FDS Name and manipulate it.getFDSAtominternal utility is in charge of polling for the atom and hiding the internal suffix_fdsStatewhich does not need to be known by external callers.