Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bundles/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const selectors = {
*/
selectAnalyticsOptedOut: (state) => state.analytics.optedOut,
/**
* Show or hide all UI compontent related to analytics.
* Show or hide all UI component related to analytics.
* @param {State} state
*/
selectShowAnalyticsComponents: (state) => state.analytics.showAnalyticsComponents,
Expand Down
8 changes: 4 additions & 4 deletions src/bundles/files/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ const actions = () => ({
}),

/**
* Fetches conten for the currently selected path. And updates
* `state.pageContent` on succesful completion.
* Fetches content for the currently selected path. And updates
* `state.pageContent` on successful completion.
* @param {Info} info
* @returns {function(Context): *}
*/
Expand Down Expand Up @@ -314,7 +314,7 @@ const actions = () => ({
// Skip ignored files
.filter($ => !IGNORED_FILES.includes(basename($.path)))
// Dropped files come as absolute, those added by the file input come
// as relative paths, so normalise all to be relative.
// as relative paths, so normalize all to be relative.
.map($ => $.path[0] === '/' ? { ...$, path: $.path.slice(1) } : $)

const totalSize = files.reduce((prev, { size }) => prev + size, 0)
Expand Down Expand Up @@ -379,7 +379,7 @@ const actions = () => ({
}),

/**
* Deletes `files` with provided paths. On completion (success sor fail) will
* Deletes `files` with provided paths. On completion (success or fail) will
* trigger `doFilesFetch` to update the state.
* @param {Object} args
* @param {FileStat[]} args.files
Expand Down
8 changes: 4 additions & 4 deletions src/bundles/files/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { debouncedProvide } from '../../lib/files.js'
* 4. `{ status: 'Failed', id: Symbol, error: Error }` - State when task is
* failed do to error.
*
* template {string} Name - Name of the task which, correponds to `.type` of
* template {string} Name - Name of the task which, corresponds to `.type` of
* dispatched actions.
* template State - Type of yielded value by a the generator, which will
* correspond to `.job.state` of dispatched actions while task is pending.
Expand Down Expand Up @@ -64,7 +64,7 @@ import { debouncedProvide } from '../../lib/files.js'
* @template Success - Type of the `action.task.result.vaule` when task is
* complete successfully. It is also a value of the promise returned by
* running `store.doX` created by this decorator.
* @template Init - Type of the initialization paramater.
* @template Init - Type of the initialization parameter.
* @template State - Type of the `context.getState()` for this task.
* @template {BundlerContext<State, Spawn<Type, Message, Error, Success, Init>, Ext, Extra>} Context
*
Expand Down Expand Up @@ -112,10 +112,10 @@ export const spawn = (type, task, ...[init]) => async (context) => {
* `context.getIpfs()` returns an `IPFSService` passing it into the task as a
* first argument. Otherwise it fails without dispatching any actions.
*
* @template {string} Type - Type of the task which, correponds to `.type` of
* @template {string} Type - Type of the task which, corresponds to `.type` of
* dispatched actions.
* @template Success - Return type of the task, which will correspond to
* `.job.result.value` of dispatched action on succefully completed task.
* `.job.result.value` of dispatched action on successfully completed task.
* @template Init - Initial data
* @template State - Type of the `context.getState()` for this task.
* @template {BundlerContext<State, Perform<Type, Error, Success, Init>, Ext, Extra>} Context
Expand Down
2 changes: 1 addition & 1 deletion src/bundles/peer-bandwidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const bundle = function (opts) {
opts.tickResolution = opts.tickResolution || 1000
// The minimum time between updates for each peer
opts.peerUpdateInterval = opts.peerUpdateInterval || 5000
// Inactive peers are de-prioritised
// Inactive peers are de-prioritized
opts.inactivePeerUpdateInterval = opts.inactivePeerUpdateInterval || 30000

return {
Expand Down
2 changes: 1 addition & 1 deletion src/bundles/peer-locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function createPeersLocations (opts) {
})
}

// Avoid unnecessary selector recomputation and re-renders: return
// Avoid unnecessary selector re-computation and re-renders: return
// the previous data reference when nothing actually changed. This is
// cheap because memoryCache (HLRU) returns the same value references
// for the same IPs, so a shallow comparison suffices.
Expand Down
34 changes: 17 additions & 17 deletions src/bundles/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* @typedef {Object} InitState
* @property {'Init'} status
* @property {Symbol} id - Unique identifier of this task.
* @property {Init} init - Initialization paramater provided on spawn.
* @property {Init} init - Initialization parameter provided on spawn.
*/

/**
* Reperesents task in it's completion phase.
* Represents task in it's completion phase.
*
* @template Failure = Error - Type of `result.error` if failed.
* @template Success - Type of `result.value` if succeeded.
Expand All @@ -36,7 +36,7 @@
*/

/**
* Type reperesenting a state of the performed task. It is state machine
* Type representing a state of the performed task. It is state machine
* representing task state that will initial be in `InitState` and on completion
* transition to `ExitState`.
*
Expand All @@ -51,7 +51,7 @@
*
* @template {string} Type - String literal used as `action.type`.
* @template Failure - Type of the `result.error` for a failed task.
* @template Success - Type of the `result.value` for the successfull task.
* @template Success - Type of the `result.value` for the successful task.
* @template Init - Initialization parameter passed to perform.
* @typedef {Object} Perform
* @property {Type} type
Expand All @@ -60,7 +60,7 @@

/**
* Takes the action `type`, a `task` (in form of async function) and an optional
* `init` parameters to produce a `doX` style action creator. On exectuion
* `init` parameters to produce a `doX` style action creator. On execution
* `{ type, task }` actions will be dispatched, where `task` represents a state
* (machine) of the executed task, which proceeds as follows:
*
Expand All @@ -70,20 +70,20 @@
* optional parameter that was passed to `perform` (Which can be useful in
* certain reducers and middleware that need to keep track of state).
*
* - Once task is finishes, action with status `Exit` is dispatced just once:
* - Once task is finishes, action with status `Exit` is dispatched just once:
* `{ status: 'Exit', id: Symbol, duration: number, result: Result<Error, Success> }`
* with some new new fields:
* - `duration` - Is a time it took a task from `Init` to `Exit` in ms.
* - `result` - Is a result of the task. On succesful completion it is
* - `result` - Is a result of the task. On successful completion it is
* `{ok:true, value:Success}` (value is return value of the async
* function). On failure it is `{ok:false, error:Error}` (`error` is an
* expception thrown, or a rejection reason of the promise).
* exception thrown, or a rejection reason of the promise).
*
* @template {string} Type - Corresponds to `action.type` for all the actions
* @template Success - Type of the `action.task.result.vaule` when task is
* complete successfully. It is also a value of the promise returned by
* running `store.doX` created by this decorator.
* @template Init - Type of the initialization paramater.
* @template Init - Type of the initialization parameter.
* @template State - Type of the `context.getState()` for this task.
* @template {Object} StoreExt - Store extension.
* @template {Object} ContextExt - Context extension
Expand All @@ -109,7 +109,7 @@ export const perform = (type, task, ...[init]) =>
*/

/**
* Type reperesenting a state of the spawned task. It is state machine that will
* Type representing a state of the spawned task. It is state machine that will
* transition from InitState -> SendState -> ExitState. It is guaranteed that
* spawned task will be in `InitState` and `ExitState` exactly once. It is also
* guaranteed that task can be in `SendState` 0 or 1 or more times between
Expand Down Expand Up @@ -144,7 +144,7 @@ export const perform = (type, task, ...[init]) =>
*
* It takes the action `type`, a `task` (in form of async generator) and an
* optional `init` parameters to produce a `doX` style action creator. On
* exectuion `{ type, task }` actions will be dispatched, where `task`
* execution `{ type, task }` actions will be dispatched, where `task`
* represents a state (machine) of the executed task, which proceeds as follows:
*
* - At the start of the execution, task will have an `Init` status, which is
Expand All @@ -154,19 +154,19 @@ export const perform = (type, task, ...[init]) =>
* certain reducers and middleware that need to keep track of state).
*
* - During execution task may produce messages by yielding them. On each
* message dispatche actions task will have a `Send` status:
* message dispatch actions task will have a `Send` status:
* `{ status: 'Send', id: Symbol, message: Message }`. Task can produce >= 0
* such actions. (If your task produces 0 messages you want to use perform
* instead).
*
Once task is finishes, action with status `Exit` is dispatced just once:
Once task is finishes, action with status `Exit` is dispatched just once:
* `{ status: 'Exit', id: Symbol, duration: number, result: Result<Error, Success> }`
* with some new new fields:
* - `duration` - Is a time it took a task from `Init` to `Exit` in ms.
* - `result` - Is a result of the task. On succesful completion it is
* - `result` - Is a result of the task. On successful completion it is
* `{ok:true, value:Success}` (value is return value of the async
* generator). On failure it is `{ok:false, error:Error}` (`error` is an
* expception thrown, or a rejection reason of the promise).
* exception thrown, or a rejection reason of the promise).
*
* @template {string} Type - Corresponds to `action.type` for all the actions
* that this task will dispatch.
Expand All @@ -176,15 +176,15 @@ export const perform = (type, task, ...[init]) =>
* @template Success - Type of the `action.task.result.vaule` when task is
* complete successfully. It is also a value of the promise returned by
* running `store.doX` created by this decorator.
* @template Init - Type of the initialization paramater.
* @template Init - Type of the initialization parameter.
* @template State - Type of the `context.getState()` for this task.
* @template {Object} StoreExt - Store extension.
* @template {Object} ContextExt - Context extension
* @template {BundlerContext<State, Spawn<Type, Message, Error, Success, Init>, StoreExt, ContextExt>} Context
*
* @param {Type} type - Type of the actions this will dispatch.
* @param {(context:Context) => AsyncGenerator<Message, Success, void>} task - Task
* @param {Init[]} rest - Optinal initialization parameter.
* @param {Init[]} rest - Optional initialization parameter.
* @returns {(context:Context) => Promise<Success>}
*/export const spawn = (type, task, ...[init]) => async (context) => {
// Generate unique id for this task
Expand Down
Loading