How to use the normalizr.denormalize function in normalizr

To help you get started, we’ve selected a few normalizr 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 pluto-net / scinapse-web-client / app / containers / newProfile / index.tsx View on Github external
function mapStateToProps(state: AppState) {
  return {
    currentUser: state.currentUser,
    profileNew: state.profileNew,
    profile: denormalize(state.profileNew.profileId, profileSchema, state.entities),
  };
}
github streamr-dev / streamr-platform / app / src / marketplace / modules / deprecated / purchaseDialog / selectors.js View on Github external
    (id: ?ProductId, entities: EntitiesState): ?Product => denormalize(id, productSchema, entities),
)
github cloudfoundry / stratos / src / frontend / app / store / helpers / schema-tree-traverse.ts View on Github external
public getFlatTree(treeDefinition: IRecursiveDelete, state: Partial): IFlatTree {
    const { schema, guid } = treeDefinition;
    const denormed = denormalize(guid, schema, state);
    this.entityExcludes = this.excludes[schema.key] || [];
    return this.build(schema, denormed, undefined, true);
  }
github pluto-net / scinapse-web-client / app / containers / paperShow / select.tsx View on Github external
export const getMemoizedPaper = createSelector([getPaperId, getPaperEntities], (paperId, paperEntities) => {
  const paper: Paper | null = denormalize(paperId, paperSchema, { papers: paperEntities });
  return paper;
});
github Superjo149 / auryo / src / renderer / modules / playlists / Playlist.jsx View on Github external
const mapStateToProps = (state, props) => {
    const { auth, entities, objects, player: { playingTrack }, app, player, ui } = state
    const { object_id, object_type, location, history } = props

    const playlist_objects = objects[object_type] || {}
    const playlist_object = playlist_objects[object_id]

    let denormalized = []

    if (playlist_object) {
        denormalized = denormalize(playlist_object.items, new schema.Array({
            playlists: playlistSchema,
            tracks: trackSchema
        }, (input) => `${input.kind}s`), entities)
    }

    return {
        entities,
        auth,
        playingTrack,
        app,
        player,
        playlist_object,
        items: denormalized,
        scrollTop: history.action === 'POP' ? ui.scrollPosition[location.pathname] : undefined
    }
}
github andrewngu / sound-redux / client / src / selectors / PlayerSelectors.js View on Github external
(entities, playingSongId) => (playingSongId !== null
    ? denormalize(playingSongId, songSchema, entities)
    : null
  ),
);
github osmlab / maproulette3 / src / components / AdminPane / HOCs / WithCurrentProject / WithCurrentProject.js View on Github external
challenges = _map(this.challengeProjects(projectId, this.props), challenge =>
          denormalize(challenge, challengeDenormalizationSchema(), this.props.entities)
        )
github keenwon / vue-normalizr-example / src / store / v1 / modules / comment.ts View on Github external
return (newsId: number) => {
      let commentIds = state.map[newsId];

      if (!commentIds) {
        return [];
      }

      return denormalize(commentIds, [commentSchema], rootState.entities);
    }
  }
github freeCodeCamp / pantry-for-good / client / modules / customer / reducer.js View on Github external
entities =>
        denormalize({customers: id}, {customers: customerSchema}, entities).customers
    )(state),
github streamr-dev / streamr-platform / app / src / marketplace / modules / myPurchaseList / selectors.js View on Github external
(entities: EntitiesState): Array => {
        const ids = entities.subscriptions != null ? Object.keys(entities.subscriptions) : []
        return denormalize(ids, subscriptionsSchema, entities)
    },
)