3.0.2 • Published 1 year ago

fusion-tokens v3.0.2

Weekly downloads
290
License
MIT
Repository
github
Last release
1 year ago

Build status

fusion-tokens

Dependency injection tokens for Fusion.js.

Fusion.js 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 Fusion.js team.


Table of contents


Installation

yarn add fusion-tokens

API

FetchToken

import {FetchToken} from 'fusion-tokens';

A token for a fetch implementation.

Types
type Fetch = (input: string, options: Object) => Promise<Response>

Typically, fetch or a polyfill such as unfetch.

LoggerToken

import {LoggerToken} from 'fusion-tokens';

A token for a logger implementation.

Types
type Logger = {
  log(level: string, arg: any): void,
  error(arg: any): void,
  warn(arg: any): void,
  info(arg: any): void,
  verbose(arg: any): void,
  debug(arg: any): void,
  silly(arg: any): void,
}

Typically, console or a logger library such as Winston.

SessionToken

import {SessionToken} from 'fusion-tokens';

A token for a session implementation.

Types
type Session = {
  from(ctx: Context): {
    get(key: string): any,
    set(key: string, val: any): void,
  },
}

Typically, the service provided by fusion-plugin-jwt or a custom wrapper around similar key-value store APIs (such as Redis).

3.0.2

1 year ago

2.4.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.3

1 year ago

2.2.11

2 years ago

2.2.10

2 years ago

2.2.9

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.2.8

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

3 years ago

2.1.11

3 years ago

2.1.10

3 years ago

2.1.9

3 years ago

2.1.8

3 years ago

2.1.7

3 years ago

2.1.6

3 years ago

2.1.5

3 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.1.0-0

6 years ago

1.0.4

6 years ago

1.0.4-0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.2

6 years ago