createContextToken

A lookup token associated with a dependency provider, for use with the Marble.js context system.

Importing

import { createContextToken } from '@marblejs/core';

Type declaration

createContextToken :: () -> ContextToken

Example

The following example creates and associates injection token with Marble.js WebSocket server.

import { createContextToken } from '@marblejs/core';
import { MarbleWebSocketServer } from '@marblejs/websockets';

export const WebSocketServerToken = createContextToken<MarbleWebSocketServer>();

Last updated