Open sdgluck opened 8 years ago
Thoughts for the implementer...
Changes to API:
wpapi
option should accept a Promise which should resolve with instance of node-wpapi
(a la WPAPI.discover
).
node-wpapi
instance and register them internally so the decorators recognise them as legitimate.contentTypes
be ignored if wpapi
config option receives a Promise?Changes to internals:
wpapi.js
: should store node-wpapi
instance as a Promise regardless of whether wpapi
config option is a Promise. i.e. the config option value should be passed through Promise.resolve()
.redux/sagas.js
: fetch
saga should wait on resolution of the wpapi
Promise. e.g. const wpapi = yield getWP()
before performing the query.In progress on branch autodiscovery-support
.
At the moment the user is required to define explicitly the custom content types that are defined within the WP instance they are connecting to. It would be great if they could be "auto-discovered" a la
node-wpapi
, probably through an option.Implementing this would require deferring calls to the WP API until the autodiscovery completed, so keeping a record internally somewhere of its completion.