
const User = {
	hasRole(roles) {
		if (Array.isArray(roles)) {
			return roles.findIndex((r) => this.roles.includes(r)) >= 0;
		} else {
			return this.roles.indexOf(roles) >= 0;
		}
	}
};

const makeUser = (data) => Object.assign(Object.create(User), data);

const user = (
	state = null,
	action
) => {
	switch (action.type) {
		case 'USER::RESPONSE_SIGNIN':
			return makeUser(action.user);
		case 'USER::SIGNOUT':
			return null;
		default:
			return state;
	}
};

export default user;

@@ -77,17 +77,12 @@
 les.
-findIndex
+some
 ((r)
@@ -108,21 +108,16 @@
 udes(r))
- %3E= 0
 ;%0A%09%09%7D el

update Role::hasRole method in client code