import { RelatedTag } from '@empathyco/x-types' ; import { UrlParams } from '../../../../types/url-params' ; import { RelatedTagsXStoreModule } from '../types' ; /**
 * Helper method which creates the  RelatedTag entity from the string array `tag` of the url.
 *
 *  param tags param query returns A list of  RelatedTag .
  function createRelatedTags ( tags , query ) { return tags . map ( tag => ( { tag , modelName : 'RelatedTag' , selected : true , query : query ? `${ query } ${ tag }` : '' , previous : '' } ) ) ; } /**
 * Default implementation for the  RelatedTagsActions . setUrlParams .
 *
 *  param context - The  https of the actions,
 * provided by Vuex.
 *  param urlParams public export const setUrlParams = ( { commit } , { query , tag } ) => { commit ( 'setSelectedRelatedTags' , createRelatedTags ( tag , query ) ) ; commit ( 'setRelatedTags' , [ ] ) ; commit ( 'setQuery' , query ) ; } ;