first commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
|
||||
export function updateBreakpoint( breakpoint ) {
|
||||
return {
|
||||
type: 'UPDATE_BREAKPOINT',
|
||||
breakpoint,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
const {
|
||||
registerStore,
|
||||
} = wp.data;
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import reducer from './reducer';
|
||||
import * as selectors from './selectors';
|
||||
import * as actions from './actions';
|
||||
|
||||
registerStore( 'canvas/breakpoint', { reducer, selectors, actions } );
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
function reducer( state = { breakpoint: '' }, action ) {
|
||||
switch ( action.type ) {
|
||||
case 'UPDATE_BREAKPOINT':
|
||||
return {
|
||||
...state,
|
||||
breakpoint: action.breakpoint,
|
||||
};
|
||||
// no default
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
export default reducer;
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
export function getBreakpoint( state, data ) {
|
||||
return state.breakpoint;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
export function updateScheme( scheme ) {
|
||||
return {
|
||||
type: 'UPDATE_SCHEME',
|
||||
scheme,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
const {
|
||||
registerStore,
|
||||
} = wp.data;
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import reducer from './reducer';
|
||||
import * as selectors from './selectors';
|
||||
import * as actions from './actions';
|
||||
|
||||
registerStore( 'canvas/scheme', { reducer, selectors, actions } );
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
function reducer( state = { scheme: '' }, action ) {
|
||||
|
||||
switch ( action.type ) {
|
||||
case 'UPDATE_SCHEME':
|
||||
return {
|
||||
...state,
|
||||
scheme: action.scheme,
|
||||
};
|
||||
// no default
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
export default reducer;
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
export function getScheme( state, data ) {
|
||||
return state.scheme;
|
||||
}
|
||||
Reference in New Issue
Block a user