mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
🔥 Remove irrelevant README
This commit is contained in:
parent
cb7682b362
commit
f9a8041d4a
1 changed files with 0 additions and 45 deletions
|
@ -1,45 +0,0 @@
|
|||
# Store template
|
||||
|
||||
This template contains all files for a Redux store.
|
||||
|
||||
## New Store: Redux integration
|
||||
|
||||
1. Copy this folder, give it a correct name.
|
||||
2. Check each file for `<UNKNOWN>` placeholders and `TODO` remarks.
|
||||
3. Edit the main store-index file and add the relevant store integration there.
|
||||
4. Check the debug-module, and add relevant debug code.
|
||||
- Register the store in the `reset()` method.
|
||||
|
||||
---
|
||||
|
||||
Main store-index:
|
||||
`modules/ppcp-settings/resources/js/data/index.js`
|
||||
|
||||
Sample store integration:
|
||||
```js
|
||||
import * as YourStore from './yourStore';
|
||||
// ...
|
||||
YourStore.initStore();
|
||||
// ...
|
||||
export const YourStoreHooks = YourStore.hooks;
|
||||
// ...
|
||||
export const YourStoreName = YourStore.STORE_NAME;
|
||||
// ...
|
||||
addDebugTools( window.ppcpSettings, [ ..., YourStoreName ] );
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### New Store: PHP integration
|
||||
|
||||
1. Create the **REST endpoint** for hydrating and persisting data.
|
||||
- `modules/ppcp-settings/src/Endpoint/YourStoreRestEndpoint.php`
|
||||
- Extend from base class `RestEndpoint`
|
||||
2. Create the **data model** class to manage the DB interaction.
|
||||
- `modules/ppcp-settings/src/Data/YourStoreSettings.php`
|
||||
- Extend from base class `AbstractDataModel`
|
||||
3. Create relevant **DI services** for both files.
|
||||
- `modules/ppcp-settings/services.php`
|
||||
4. Register the REST endpoint in the **service module**.
|
||||
- `modules/ppcp-settings/src/SettingsModule.php`
|
||||
- Find the action `rest_api_init`
|
Loading…
Add table
Add a link
Reference in a new issue