1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-04 04:55:25 +02:00
planka/client/src/selectors/all.js

19 lines
500 B
JavaScript
Executable file

import { createSelector } from 'redux-orm';
import orm from '../orm';
import { currentUserIdSelector } from './current';
export const allUsersSelector = createSelector(orm, ({ User }) =>
User.getOrderedUndeletedQuerySet().toRefArray(),
);
export const allUsersExceptCurrentSelector = createSelector(
orm,
state => currentUserIdSelector(state),
({ User }, currentUserId) =>
User.getOrderedUndeletedQuerySet()
.exclude({
id: currentUserId,
})
.toRefArray(),
);