mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
23 lines
375 B
JavaScript
23 lines
375 B
JavaScript
import { addAction, addReducer } from 'meteor/vulcan:core';
|
|
|
|
addAction({
|
|
postsViewed: {
|
|
setViewed: (postId) => ({
|
|
type: 'SET_VIEWED',
|
|
postId,
|
|
}),
|
|
},
|
|
});
|
|
|
|
addReducer({
|
|
postsViewed: (state = [], action) => {
|
|
if (action.type === 'SET_VIEWED') {
|
|
return [
|
|
...state,
|
|
action.postId,
|
|
];
|
|
}
|
|
|
|
return state;
|
|
},
|
|
});
|