const Pinterest = {
pins: (boardName, callback) => {
var params = {
fields: "id, note, link, image",
limit: 100
var boardId = `test`;
PDK.request(`${boardId}/pins/`, params, callback);
type BoardPinsResponse = {
data: Array<Pin>;
hasNext?: boolean;
page?: {
cursor: string;
next: string;
// This is the straight URL that would grab the next set of data
next: () => BoardPinsResponse
// This is a helper function that is supposed to grab the data from the "next" URL above
};
mergeMap(action =>
new Observable(subscriber => {
var pins = [];
PDK.request('/boards/<board_id>/pins/', function (response) { // Make sure to change the board_id
if (!response || response.error) {
subscriber.next(fetchPinsAsync.failure(response.error));
subscriber.complete();
return;
pins = pins.concat(response.data);
if (response.hasNext) {
response.next(); // this will recursively go to this same callback
return;
subscriber.next(fetchPinsAsync.success({
month: action.payload,