MCPcopy
hub / github.com/dvajs/dva / use

Method use

packages/dva-core/src/Plugin.js:34–52  ·  view source on GitHub ↗
(plugin)

Source from the content-addressed store, hash-verified

32 }
33
34 use(plugin) {
35 invariant(
36 isPlainObject(plugin),
37 'plugin.use: plugin should be plain object'
38 );
39 const hooks = this.hooks;
40 for (const key in plugin) {
41 if (Object.prototype.hasOwnProperty.call(plugin, key)) {
42 invariant(hooks[key], `plugin.use: unknown plugin property: ${key}`);
43 if (key === '_handleActions') {
44 this._handleActions = plugin[key];
45 } else if (key === 'extraEnhancers') {
46 hooks[key] = plugin[key];
47 } else {
48 hooks[key].push(plugin[key]);
49 }
50 }
51 }
52 }
53
54 apply(key, defaultHandler) {
55 const hooks = this.hooks;

Callers 6

createFunction · 0.95
effects.test.jsFile · 0.80
plugin.test.jsFile · 0.80
index.test.jsFile · 0.80
index.test.jsFile · 0.80
server.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected