UNPKG

@sleeperhq/mini-core

Version:

Core library frameworks for developing Sleeper Mini Apps.

19 lines (14 loc) 397 B
import Rx from 'rx'; class MiniLogger { public static messages = new Rx.Subject; static log(...args: any[]) { this.messages.onNext({ type: 'mini_dev_server', action: 'onConsoleLog', message: Array.from(args).join(' '), }); } } // Add global function for mini logging global.log_mini = (...args: any[]) => { MiniLogger.log(...args); } export default MiniLogger;