import {DELETE_POST, ADD_POSTS, LOADING_POSTS, RESET_STATE} from '../actions/Posts'
import { createStore } from 'redux'
import reducer from '../reducers/Posts';
const store = createStore(reducer);
export default store;

export function loading() {
    store.dispatch({type: LOADING_POSTS});
}

export function addPosts(posts) {
    store.dispatch({type: ADD_POSTS, posts});
}

export function deletePostAction(_id){
    store.dispatch({type: DELETE_POST, _id});
}

export function resetState(){
    store.dispatch({type: RESET_STATE});
}