import { ConfigPlugin } from '../Plugin.types' ; import { addHistoryItem , getHistoryItem , PluginHistoryItem } from '../utils/history' ; param config param name export const withRunOnce = ( config , { plugin , name , version } ) => { if ( getHistoryItem ( config , name ) ) { return config ; } config = addHistoryItem ( config , { name , version } ) ; return plugin ( config ) ; } ; param action export function createRunOncePlugin < T > ( plugin , name , version ? ) { return ( config , props ) => { return withRunOnce ( config , { plugin : config => plugin ( config , props ) , name , version } ) ; } ; }