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
25,685 changes: 15,139 additions & 10,546 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-saga-devtools",
"version": "0.3.0",
"version": "0.4.0",
"description": "Monitor and UI for redux-saga",
"main": "lib/index.js",
"devDependencies": {
Expand All @@ -16,10 +16,12 @@
"cross-env": "^3.1.3",
"eslint": "^4.11.0",
"jest": "^24.9.0",
"parcel": "^1.12.4",
"parcel": "1.12.3",
"react-redux": "^5.0.0",
"redux": "^3.6.0",
"redux-saga": "^0.16.0",
"redux-saga": "^1.0.0",
"@redux-saga/is": "^1.0.0",
"@redux-saga/symbols": "^1.0.0",
"regenerator-runtime": "^0.13.3",
"rimraf": "^2.5.4",
"tap-spec": "^4.1.1"
Expand All @@ -32,7 +34,9 @@
"styled-components": "^2.2.4"
},
"peerDependecies": {
"redux-saga": "^0.15.6"
"redux-saga": "^1.0.0",
"@redux-saga/is": "^1.0.0",
"@redux-saga/symbols": "^1.0.0"
},
"scripts": {
"lint": "eslint src",
Expand Down
6 changes: 3 additions & 3 deletions src/components/Effect/Effect.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import PropTypes from 'prop-types';
import PropTypes from 'prop-types'
import React from 'react';
import styled from 'styled-components'
import { is, asEffect } from 'redux-saga/utils'
import * as is from '@redux-saga/is'
import asEffect from '../../utils/asEffect';
import { Row, Cell } from '../Layout'
import SagaValue from '../SagaValue'
import Result from './Result'


const EffectType = styled.span`
color: ${props => props.theme.effectType};
margin-right: 5px;
Expand Down
5 changes: 3 additions & 2 deletions src/components/SagaValue/SagaValue.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import { is, CHANNEL_END } from 'redux-saga/utils'
import * as is from '@redux-saga/is'
import { CHANNEL_END_TYPE } from '@redux-saga/symbols'
import JSValue from '../JSValue'
import SagaRef from '../../containers/SagaRef'

export default function SagaValue({value, label, isIdentifier}) {
if(is.channel(value)) {
return <SagaRef object={value}>{label || 'Channel'}</SagaRef>
}
else if(CHANNEL_END && value === CHANNEL_END) {
else if(CHANNEL_END_TYPE && value === CHANNEL_END_TYPE) {
return <JSValue value={'END'} isIdentifier={true} />
}
else {
Expand Down
2 changes: 0 additions & 2 deletions src/containers/EffectView/helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { is, asEffect } from 'redux-saga/utils'

export function pathHasChanged(currentPath, newPath) {
if(
(!currentPath && newPath) ||
Expand Down
3 changes: 2 additions & 1 deletion src/store/__tests__/monitor.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { asEffect, SAGA_ACTION } from "redux-saga/utils";
import createSagaMonitor from "../createSagaMonitor";
import { SAGA_ACTION } from "@redux-saga/symbols";
import { CHILDREN } from "../reducers";
import * as c from "../constants";
import asEffect from "../../utils/asEffect";

asEffect.race = eff => {
return eff.race;
Expand Down
5 changes: 3 additions & 2 deletions src/store/createSagaMonitor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { is, SAGA_ACTION } from 'redux-saga/utils'
import * as is from '@redux-saga/is'
import { SAGA_ACTION } from '@redux-saga/symbols'
import { createStore } from 'redux'
import rootReducer from './reducers'
import {
Expand Down Expand Up @@ -37,7 +38,7 @@ export default function createSagaMonitor({time = getTime, dispatch: customDispa

function effectResolved(effectId, result) {
if(is.task(result)) {
result.done.then(
result.toPromise().then(
taskResult => {
if(result.isCancelled())
effectCancelled(effectId)
Expand Down
4 changes: 2 additions & 2 deletions src/store/reducers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { asEffect } from "redux-saga/utils";
import asEffect from "../utils/asEffect";
import { combineReducers } from "redux";
import {
EFFECT_TRIGGERED,
Expand All @@ -20,7 +20,7 @@ function getPathToEffect(effect, effectsById) {
const path = [effectId];

while (effectId) {
effectId = effect.parentEffectId;
effectId = effect && effect.parentEffectId;
if (effectId) {
path.push(effectId);
effect = effectsById[effectId];
Expand Down
3 changes: 2 additions & 1 deletion src/store/selectors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { is, asEffect } from 'redux-saga/utils'
import * as is from '@redux-saga/is'
import asEffect from '../utils/asEffect'
import { STATUS_RESOLVED } from './constants'

/* eslint-disable no-cond-assign */
Expand Down
30 changes: 30 additions & 0 deletions src/utils/asEffect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { effectTypes } from "redux-saga/effects"
import { IO } from "@redux-saga/symbols"
/**
* A copy of asEffect from redux-saga 0.x
* https://github.com/redux-saga/redux-saga/blob/0.x/src/internal/io.js#L183
*
* With slight adjustments for new effect structure
* https://github.com/redux-saga/redux-saga/blob/v1.0.0/CHANGELOG.md?plain=1#L22
*/
const createAsEffectType = type => effect => effect && effect[IO] && effect.type === type && effect.payload

export const asEffect = {
take: createAsEffectType(effectTypes.TAKE),
put: createAsEffectType(effectTypes.PUT),
all: createAsEffectType(effectTypes.ALL),
race: createAsEffectType(effectTypes.RACE),
call: createAsEffectType(effectTypes.CALL),
cps: createAsEffectType(effectTypes.CPS),
fork: createAsEffectType(effectTypes.FORK),
join: createAsEffectType(effectTypes.JOIN),
cancel: createAsEffectType(effectTypes.CANCEL),
select: createAsEffectType(effectTypes.SELECT),
actionChannel: createAsEffectType(effectTypes.ACTION_CHANNEL),
cancelled: createAsEffectType(effectTypes.CANCELLED),
flush: createAsEffectType(effectTypes.FLUSH),
getContext: createAsEffectType(effectTypes.GET_CONTEXT),
setContext: createAsEffectType(effectTypes.SET_CONTEXT)
}

export default asEffect