Skip to content

Commit

Permalink
Improve the state persistence and use modern PHP array notation
Browse files Browse the repository at this point in the history
  • Loading branch information
Copons committed Dec 19, 2019
1 parent 2f0cd2f commit 5d278bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ public function get_nux_status() {
} else {
$nux_status = get_user_meta( get_current_user_id(), 'wpcom_block_editor_nux_status', true );
}
return rest_ensure_response(
array(
'is_nux_enabled' => $this->is_nux_enabled( $nux_status ),
)
);
return rest_ensure_response( array( 'is_nux_enabled' => $this->is_nux_enabled( $nux_status ) ) );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
* External dependencies
*/
import apiFetch from '@wordpress/api-fetch';
import { plugins, registerStore, use } from '@wordpress/data';

use( plugins.persistence, {} );
import { registerStore } from '@wordpress/data';

const reducer = ( state = {}, { type, isNuxEnabled } ) =>
'WPCOM_BLOCK_EDITOR_NUX_SET_STATUS' === type ? { ...state, isNuxEnabled } : state;
Expand Down

0 comments on commit 5d278bc

Please sign in to comment.