(plugin)
| 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; |
no outgoing calls
no test coverage detected