Name Description Size
debounce.js Redux middleware for debouncing actions. Schedules actions with { meta: { debounce: true } } to be delayed by wait milliseconds. If another action is fired during this time-frame both actions are inserted into a queue and delayed. Maximum delay is defined by maxWait argument. Handling more actions at once results in better performance since components need to be re-rendered less often. @param string wait Wait for specified amount of milliseconds before executing an action. The time is used to collect more actions and handle them all at once. @param string maxWait Max waiting time. It's used in case of a long stream of actions. 2470
ignore.js A middleware that prevents any action of being called once it is activated. This is useful to apply while destroying a given panel, as it will ignore all calls to actions, where we usually make our client -> server communications. This middleware should be declared before any other middleware to to effectively ignore every actions. 1277
log.js A middleware that logs all actions coming through the system to the console. 977
moz.build 515
performance-marker.js This function returns a middleware, which is responsible for adding markers that will be visible in performance profiles, and may help investigate performance issues. Example usage, adding a marker when console messages are added, and when they are cleared: return createPerformanceMarkerMiddleware({ "MESSAGES_ADD": { label: "WebconsoleAddMessages", sessionId: 12345, getMarkerDescription: function({ action, state }) { const { messages } = action; const totalMessageCount = state.messages.mutableMessagesById.size; return `${messages.length} messages handled, store now has ${totalMessageCount} messages`; }, }, "MESSAGES_CLEARED": { label: "WebconsoleClearMessages", sessionId: 12345 }, }); @param {Object} cases: An object, keyed by action type, that will determine if a given action will add a marker. @param {String} cases.{actionType} - The type of the action that will trigger the marker creation. @param {String} cases.{actionType}.label - The marker label @param {Integer} cases.{actionType}.sessionId - The telemetry sessionId. This is used to be able to distinguish markers coming from different toolboxes. @param {Function} [cases.{actionType}.getMarkerDescription] - An optional function that will be called when adding the marker to populate its description. The function is called with an object holding the action and the state 2578
promise.js 1828
task.js A middleware that allows async thunks (async functions) to be dispatched. The middleware is called "task" for historical reasons. TODO: rename? 1025
thunk.js A middleware that allows thunks (functions) to be dispatched If it's a thunk, it is called with an argument that will be an object containing `dispatch` and `getState` properties, plus any additional properties defined in the `options` parameters. This allows the action to create multiple actions (most likely asynchronously). 835
wait-service.js A middleware which acts like a service, because it is stateful and "long-running" in the background. It provides the ability for actions to install a function to be run once when a specific condition is met by an action coming through the system. Think of it as a thunk that blocks until the condition is met. Example: ```js const services = { WAIT_UNTIL: require('wait-service').NAME }; { type: services.WAIT_UNTIL, predicate: action => action.type === constants.ADD_ITEM, run: (dispatch, getState, action) => { // Do anything here. You only need to accept the arguments // if you need them. `action` is the action that satisfied // the predicate. } } ``` 2024
xpcshell