Package Exports
- fusion-tokens
- fusion-tokens/dist/browser.es5.cjs.js
- fusion-tokens/dist/browser.es5.es.js
- fusion-tokens/dist/node.cjs.js
- fusion-tokens/dist/node.es.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fusion-tokens) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fusion-tokens
Dependency injection tokens for FusionJS.
FusionJS dependency injection is based on tokens rather than strings. This avoids naming collision issues. This package provides utilities to create named tokens, as well as common tokens that are used by packages maintained by the FusionJS team.
Installation
yarn add fusion-tokensAPI
createToken
import {createToken} from 'fusion-tokens';
const token = createToken(name);Creates a DI token
name: string- A human-readable name for the token. Used in error messsages.token: Token- A token
createOptionalToken
import {createOptionalToken} from 'fusion-tokens';
const token = createOptionalToken(name, defaultValue);Creates a special DI token with a default value associated with it
name: string- A human-readable name for the token. Used in error messsages.defaultValue: any- The token's default valuetoken: Token- A token
Tokens
import {FetchToken} from 'fusion-tokens';
import {LoggerToken} from 'fusion-tokens';
import {SessionToken} from 'fusion-tokens';