All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ducks.table.sagas.ts Maven / Gradle / Ivy

The newest version!
import { put, takeEvery, cancel } from 'redux-saga/effects'
import omit from 'lodash/omit'

import { registerWidget } from '../widgets/store'
import { Register } from '../widgets/Actions'

import { registerTable } from './store'

function* registerTableEffect(action: Register) {
    const { payload } = action
    const { widgetId, initProps } = payload
    const { table } = initProps

    if (!table) {
        yield cancel()
    }

    const tableInitProps = { ...omit(initProps, 'table'), ...table }

    yield put(registerTable(widgetId, tableInitProps))
}

export const sagas = [
    takeEvery(registerWidget, registerTableEffect),
]




© 2015 - 2024 Weber Informatics LLC | Privacy Policy