Passed
Pull Request — master (#75)
by Mark
03:15
created

src/Store/Connection/Adapter/LocalArrayAdapter.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 26
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
mnd 0
bc 0
fnc 3
dl 0
loc 26
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A LocalArrayAdapter.constructor 0 3 1
A LocalArrayAdapter.load 0 5 2
1
import ConnectionAdapter from '../ConnectionAdapter.js';
2
import QueueMessage from '../Queue/QueueMessage.js';
3
4
/**
5
 *
6
 */
7
export default class LocalArrayAdapter extends ConnectionAdapter {
8
    /**
9
     *
10
     * @param options
11
     */
12
    constructor(options) {
13
        super(options);
14
    }
15
16
    /**
17
     *
18
     * @param model
19
     * @return {Promise<unknown>}
20
     */
21
    load(model) {
22
        return new Promise((resolve) => {
23
            resolve(new QueueMessage(model, 'insert', this.options[model.className()]));
24
        });
25
    }
26
}