Skip to content

Commit

Permalink
fixed ignored store/logs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nk-o committed Apr 5, 2024
1 parent 3a84bd3 commit d0d5d9a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Logs
logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
Expand Down
17 changes: 17 additions & 0 deletions src/admin/store/logs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Internal dependencies
*/
import reducer from './reducer';
import * as selectors from './selectors';

/**
* WordPress dependencies
*/
import { createReduxStore, register } from '@wordpress/data';

const store = createReduxStore('redirect-txt/logs', {
reducer,
selectors,
});

register(store);
7 changes: 7 additions & 0 deletions src/admin/store/logs/reducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const { logs } = window.redirectTxtAdminData;

function reducer(state = { logs }) {
return state;
}

export default reducer;
3 changes: 3 additions & 0 deletions src/admin/store/logs/selectors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function getLogs(state) {
return state?.logs || '';
}

0 comments on commit d0d5d9a

Please sign in to comment.