Files
flipper/src/reducers/index.js
John Knox 6df906ed5f Add computeNotifications method to FlipperBasePlugin
Summary:
Method `computeNotifications` added to the base plugin class.
Plugins should implement this to define a mapping from their state+props to the notifications they are emitting.

I've plugged this into componentDidUpdate, because we don't yet have the background plugin infra. When we do, we'll want some other incoming data hook to use so it's not tied to the react component rendering.

Example usage added to network plugin in the next commit.

Reviewed By: passy

Differential Revision: D10127875

fbshipit-source-id: efd4d8cfc0d3d33852a6cf9a290549a5f90d389d
2018-10-09 08:27:06 -07:00

52 lines
1.2 KiB
JavaScript

/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import {combineReducers} from 'redux';
import application from './application.js';
import connections from './connections.js';
import pluginStates from './pluginStates.js';
import notifications from './notifications.js';
import type {
State as ApplicationState,
Action as ApplicationAction,
} from './application.js';
import type {
State as DevicesState,
Action as DevicesAction,
} from './connections.js';
import type {
State as PluginsState,
Action as PluginsAction,
} from './pluginStates.js';
import type {
State as NotificationsState,
Action as NotificationsAction,
} from './notifications.js';
import type {Store as ReduxStore} from 'redux';
export type Store = ReduxStore<
{
application: ApplicationState,
connections: DevicesState,
pluginStates: PluginsState,
notifications: NotificationsState,
},
| ApplicationAction
| DevicesAction
| PluginsAction
| NotificationsAction
| {|type: 'INIT'|},
>;
export default combineReducers({
application,
connections,
pluginStates,
notifications,
});