How to use the redux-orm.Schema 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 tommikaikkonen / redux-orm-example / app / models.js View on Github external
return AuthorModel.getQuerySetFromIds(authorIds);
    }
}
Publisher.modelName = 'Publisher';

class Genre extends CRUDModel {
    static validate(props) {
        if (props.name && props.name.length > 0) {
            return true;
        }
        return false;
    }
}
Genre.modelName = 'Genre';

const schema = new Schema();
schema.register(Author, Book, Publisher, Genre);

export {
  Book,
  Author,
  Publisher,
  Genre,
  schema,
};
github tommikaikkonen / redux-orm-primer / app / models.js View on Github external
text: PropTypes.string.isRequired,
    done: PropTypes.bool.isRequired,
    user: PropTypes.oneOfType([
        PropTypes.instanceOf(User),
        PropTypes.number,
    ]).isRequired,
    tags: PropTypes.arrayOf(PropTypes.oneOfType([
        PropTypes.instanceOf(Tag),
        PropTypes.string,
    ])).isRequired,
};
Todo.defaultProps = {
    done: false,
};

export const schema = new Schema();
schema.register(Todo, Tag, User);

export default schema;

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