How to use the redux-orm.ORM function in redux-orm

To help you get started, we’ve selected a few redux-orm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github N3TC4T / Nearby-Live / src / redux / core / stream / models.js View on Github external
}

    static get modelName() {
        return 'Comment';
    }

    static get options() {
        return {
            idAttribute: 'id'
        };
    }
}

/* Schema ==================================================================== */

const schema = new ORM();
schema.register(Post, Comment);

/* Export Schema ==================================================================== */

export default schema;
github N3TC4T / Nearby-Live / src / redux / core / system-notifications / models.js View on Github external
}

    static get modelName() {
        return 'Notification';
    }

    static get options() {
        return {
            idAttribute: 'id'
        };
    }
}

/* Schema ==================================================================== */

const schema = new ORM();
schema.register(Notification);

/* Export Schema ==================================================================== */

export default schema;
github N3TC4T / Nearby-Live / src / redux / core / conversations / models.js View on Github external
}

    static get modelName() {
        return 'Conversation';
    }

    static get options() {
        return {
            idAttribute: 'id'
        };
    }
}

/* Schema ==================================================================== */

const schema = new ORM();
schema.register(Message, Conversation);

/* Export Schema ==================================================================== */

export default schema;
github ratson / factory-bot / test / adapters / ReduxORMAdapterSpec.js View on Github external
import '../test-helper/testUtils'
import { expect } from 'chai'
import { ORM } from 'redux-orm'
import ReduxORMAdapter from '../../src/adapters/ReduxORMAdapter'
import DummyReduxORMModel from '../test-helper/DummyReduxORMModel'
import asyncFunction from '../test-helper/asyncFunction'

const orm = new ORM()
orm.register(DummyReduxORMModel)
const session = orm.session()

describe('ReduxORMAdapter', () => {
  const adapter = new ReduxORMAdapter(session)
  it('can be created', () => {
    expect(adapter).to.be.an.instanceof(ReduxORMAdapter)
  })
  describe('#build', () => {
    it(
      'builds the model',
      asyncFunction(async () => {
        const model = adapter.build('DummyReduxORMModel', {
          id: 1,
          type: 'City',
          name: 'Vic',
github meltyshev / planka / client / src / orm.js View on Github external
import { ORM } from 'redux-orm';

import {
  Action,
  Board,
  Card,
  Label,
  List,
  Notification,
  Project,
  ProjectMembership,
  Task,
  User,
} from './models';

const orm = new ORM({
  stateSelector: (state) => state.orm,
});

orm.register(
  User,
  Project,
  ProjectMembership,
  Board,
  List,
  Label,
  Card,
  Task,
  Action,
  Notification,
);
github markerikson / project-minimek / src / app / schema / schema.js View on Github external
import {ORM } from "redux-orm";

import Pilot from "features/pilots/Pilot";
import MechDesign from "features/mechs/MechDesign";
import Mech from "features/mechs/Mech";
import Unit from "features/unitInfo/Unit";
import Faction from "features/unitInfo/Faction";

const orm = new ORM();
orm.register(Pilot, MechDesign, Mech, Unit, Faction);

export default orm;
github GiraffeTools / GiraffeTools / frontend / porcupine / models / index.js View on Github external
import {ORM} from 'redux-orm';

import Language from './language';
import Link from './link';
import Parameter from './parameter';
import Port from './port';
import Sticky from './sticky';
import Node from './node';

const orm = new ORM();
orm.register(Language, Link, Parameter, Port, Node, Sticky);

export default orm;
github markerikson / project-minimek-educative / src / app / orm.js View on Github external
import {ORM} from "redux-orm";

import Mech from "features/mechs/Mech";
import MechDesign from "features/mechs/MechDesign";
import Pilot from "features/pilots/Pilot";

const orm = new ORM();

orm.register(Mech, MechDesign, Pilot);

export default orm;
github GiraffeTools / GiraffeTools / app / porcupine / js / orm.js View on Github external
import { ORM } from 'redux-orm';

import Link from './models/link';
import Node from './models/node';
import Port from './models/port';


const orm = new ORM();
orm.register(Link, Node, Port);

export default orm;
github TylerFisher / full-stack-react / fullstack / staticapp / src / js / app / stores / models / index.js View on Github external
import { ORM } from 'redux-orm';

import Division from './division';
import DivisionLevel from './divisionLevel';
import Office from './office';
import Officeholder from './officeholder';
import Party from './party';
import Person from './person';

const orm = new ORM();

orm.register(
  Division,
  DivisionLevel,
  Office,
  Officeholder,
  Party,
  Person
);

export default orm;

redux-orm

Simple ORM to manage and query your state trees

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis