
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
types-redux-orm
Advanced tools
Typescript types for Redux Orm
It's an alpha version of types I currently use in one of my projects. They will be updated as I proceed with the project. No backward compatibility guaranteed.
01/13/18 - Beta release
02/03/18 - Stable release and merge into DefinitelyTyped
npm install types-redux-orm
Modify your tsconfig.json as following:
...
"typeRoots": [
"./node_modules/types-redux-orm",
"./node_modules/@types"
],
...
import { attr, IORMCommonState, IORMId, ITableState, Model, ORM } from 'redux-orm'
export class Test extends Model<ITestStateItem, IFetchIndicatorState> {
static modelName = 'Test'
static fields = {
test: attr(),
isFetching: attr({ getDefault: () => false }),
id: attr()
}
}
// core data which we do not have defaults for
export interface ITestStateItem {
test: string
}
// optional data we provide defaults for
export interface IFetchIndicatorState {
isFetching: boolean
}
// id attr is added automatically by redux-orm therefore we have IORMId interface
export type ITestState = ITableState<ITestStateItem & IORMId & IFetchIndicatorState>
export interface ITestORMState extends IORMCommonState {
Test: ITestState
}
interface ITestORMModels {
Test: typeof Test
}
const orm = new ORM<ITestORMState>()
orm.register<ITestORMModels>(Test)
export default orm
interface ITestDTO {
test: string
}
const reducerAddItem = (state: ITestORMState, action: ActionMeta<ITestDTO, any>): ITestORMState => {
const session = orm.session(state)
session.Test.upsert<ITestStateItem>(action.payload)
return session.state
}
import { createSelector as createSelectorORM, IORMId, ISession } from 'redux-orm'
interface ITestDisplayItem {
test: string
}
type ITestDisplayItemList = ITestDisplayItem[]
export const makeGetTestDisplayList = () => {
const ormSelector = createSelectorORM<ITestORMState>(orm, (session: ISession<ITestORMState>) =>
session.Test
.all<ITestStateItem, IFetchIndicatorState>()
.toRefArray()
.map((item) => ({ ...item }))
})
return createSelector<IRootState, ITestORMState, ITestDisplayItemList>(
({ test }) => test,
ormSelector
)
}
FAQs
Typescript types for Redux-ORM
We found that types-redux-orm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.