front / gutenberg-js

JavaScript only version of the WordPress Gutenberg editor (DEPRECATED)
GNU General Public License v2.0
390 stars 42 forks source link

Is there a way of updating apiFetch after it has been set? #11

Open arnvanhoutte opened 5 years ago

arnvanhoutte commented 5 years ago

At the moment the apiFetch function has to be set at the initialization of the page. The problem I have with this is that I cannot use my angular services then because angular has not been loaded at that time. I was wondering if there maybe could be a way to set apiFetch later on, maybe at the initialization of the editor? Eg like this:

  import { apiFetch }  from 'src/app/new-api-fetch'
  import { editPost } from '@frontkom/gutenberg-js';
  editPost.initializeEditor('editor', 'page', 1, settings, {}, apiFetch);
perandre commented 5 years ago

What do you think, @SofiaSousa ?