-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Describe the feature
Exporting the utilities used in mapping functions to prevent duplicating common utils and promote reuse.
Motivation
Ripple Tide content types each have a mapping function - https://ripple.sdp.vic.gov.au/framework/guides/creating-content-types#the-mapping-object. As part of mapping the data from the backend to frontend, we have created a number of utilities that are potentially usable outside of the server mapping context. For example
const getAnchorLinkId = (str) => { |
export const getAnchorLinkId = (str: string) => { |
Proposal
Propose using the folder convention 'helpers' to store utilities that are agnostic of server or backend. These can be imported into a single index.ts file under the ./utils folder for vue context utils or imported into the server mapping as required.
Benefits
prevent duplicating common utils and promote reuse.
Drawbacks
- More overhead when defining utils
Adoption strategy
Document in https://ripple.sdp.vic.gov.au/framework/guides/creating-content-types and potentially adding unit tests
Additional information
- Would you be willing to help implement this feature?
- Could this feature be created outside of Ripple-framework as a layer?
Final checks
- I have read the contribution guide for information on submitting a feature request.
- I have checked the discussions and issues for duplicate feature requests.