Provides <wordpress-api> and window.WordPress, a declarative way to interact with your WordPress site's api through IndexedDB.
npm install wordpress-api-wcFirst, queue the script:
Finally, declare it on your site:
``html`
Loaded! Start your React/Vue/Choo/whatever app declaratively, here!
Once the component is mounted, it will begin syncing your wordpress database to a local IndexedDB. All interaction with the database will first talk to the IndexedDB, then as a fallback, it will make a network request.
js
Loaded!
`
Philosophy
It should be absurdly easy to do a Single Page App with offline access. It should be super easy to make your site super performant. You shouldn't have any challenges with interacting with IndexedDB - it should be invisible.
Events
The element will emit these three events: $3
More to come$3
More to come$3
More to come
Optimizations
$3
More to come$3
More to comeAPI
Coming soon!Installation
$3
- Put a script tag similar to this
in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc$3
- Run npm install wordpress-api-wc --save
- Put a script tag similar to this in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc$3
- Run npm install wordpress-api-wc --save
- Add { name: 'wordpress-api-wc' }` to your collections