How to use the miniapp-framework-shared.worker.pageHub function in miniapp-framework-shared

To help you get started, we’ve selected a few miniapp-framework-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / rax / packages / miniapp-framework-web / src / worker / Client.js View on Github external
import raxCode from '!!raw-loader!rax/dist/rax.min.js';
import createDriver from 'driver-worker';
import { log, worker } from 'miniapp-framework-shared';
import { applyFactory } from './getModule';
import { emit as emitPageLifecycle } from './lifecycles/page';

const raxFactory = new Function('module', 'exports', raxCode);
const { getPage, getUnknownPageFactory } = worker.pageHub;
const { on: addClientEvent } = worker.clientHub;
const CURRENT_CLIENT_ID = '__current_client_id__';
const MINIAPP_ENV = '__miniapp_env__';

export default class Client {
  constructor(clientId, pageName, pageQuery = {}) {
    this.clientId = clientId;
    this.pageName = pageName;
    this.pageQuery = pageQuery;
    this.raxInstance = createRax();
    this.eventListeners = {};

    this.setup();
  }

  setup() {

miniapp-framework-shared

Framework shared libs for MiniApp.

Unrecognized
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis