import { Data } from './models' ; internal param data param name export function getState < T = any > ( data , name ) { data . state = data . state || { } ; data . state [ name ] = data . state [ name ] || { } ; return data . state [ name ] ; } remarks public param data param name export function getPluginState < T = any > ( data , name ) { const state = getState < T > ( data , 'plugin' ) ; state [ name ] = state [ name ] || { } ; return state [ name ] ; } /**
 * Checks whether a flag is set. See  flag .
 *
 *  public param data param key export function is ( data , key ) { return ! ! getState ( data , 'flags' ) [ key ] ; } /**
 * Sets a flag value. See  is .
 *
 *  public param data param key param value export function flag ( data , key , value ) { getState ( data , 'flags' ) [ key ] = ! ! value ; }