UNPKG

refract-xstream

Version:

Refract bindings for React with xstream: harness the power of reactive programming to supercharge your components!

41 lines (40 loc) 1.21 kB
export declare const MOUNT_EVENT: string export declare const UNMOUNT_EVENT: string export declare enum DataType { EVENT = 'event', PROPS = 'props', CALLBACK = 'callback' } export declare type Data<Props> = PropsData<Props> | CallbackData | EventData export interface PropsData<Props> { type: DataType payload: Partial<Props> } export interface CallbackData { type: DataType payload: { name: string args: any[] } } export interface EventData { type: DataType payload: { name: string value?: any } } export declare const isEvent: <Props>( eventName: any ) => (data: Data<Props>, index?: any) => boolean export declare const isProps: <Props>(data: Data<Props>) => boolean export declare const isCallback: <Props>( propName: any ) => (data: Data<Props>) => boolean export declare const createEventData: (name: string, value?: any) => EventData export declare const createPropsData: <Props>(props: Props) => PropsData<Props> export declare const createCallbackData: ( name: string, args: any[] ) => CallbackData export declare const shallowEquals: (left: any, right: any) => boolean