export default Pubst;
export type PubstConfig = {
/**
* - Logger to send warning messages to.
*/
logger?: Object | undefined;
/**
* - If logger isn't provided, switches between ConsoleLogger and SilentLogger.
*/
showWarnings?: boolean | undefined;
/**
* - A store implementation for persisting topic values.
*/
store?: Object | undefined;
/**
* - An array of topic configurations.
*/
topics?: TopicConfig[] | undefined;
};
export type TopicConfig = {
/**
* - The name of the topic (REQUIRED).
*/
name: string;
/**
* - The default value presented to subscribers when the topic is undefined or null.
*/
default?: any;
/**
* - Set to true if this topic will not have payload data.
*/
eventOnly?: boolean | undefined;
/**
* - Should new subscribers automatically receive the last published value?
*/
doPrime?: boolean | undefined;
/**
* - Alert subscribers of all publish events, even if unchanged.
*/
allowRepeats?: boolean | undefined;
/**
* - Store-specific configuration passed to the store's registerTopic method.
*/
storeConfig?: Object | undefined;
};
export type SubscriptionConfig = {
/**
* - The handler to call when the topic is updated.
*/
handler: Function;
/**
* - Default value for this subscription.
*/
default?: any;
/**
* - Should the handler be primed with the last value?
*/
doPrime?: boolean | undefined;
/**
* - Should the handler be called when the value doesn't change?
*/
allowRepeats?: boolean | undefined;
};
/**
* @typedef {Object} PubstConfig
* @property {Object} [logger] - Logger to send warning messages to.
* @property {boolean} [showWarnings] - If logger isn't provided, switches between ConsoleLogger and SilentLogger.
* @property {Object} [store] - A store implementation for persisting topic values.
* @property {Array
* Available options are:
*
*
*