mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
24 lines
373 B
JavaScript
24 lines
373 B
JavaScript
![]() |
import { addAction, addReducer } from 'meteor/nova:core';
|
||
|
|
||
|
addAction({
|
||
|
postsViewed: {
|
||
|
setViewed: (postId) => ({
|
||
|
type: 'SET_VIEWED',
|
||
|
postId,
|
||
|
}),
|
||
|
},
|
||
|
});
|
||
|
|
||
|
addReducer({
|
||
|
postsViewed: (state = [], action) => {
|
||
|
if (action.type === 'SET_VIEWED') {
|
||
|
return [
|
||
|
...state,
|
||
|
action.postId,
|
||
|
];
|
||
|
}
|
||
|
|
||
|
return state;
|
||
|
},
|
||
|
});
|