0.0.5 • Published 1 year ago

http-cache-subscriptions v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

HTTP Cache Subscriptions

Check HTTP resources on an interval and cache the responses

Examples

HttpSubscription

import HttpFetchQueue from "http-fetch-queue";
import {HttpSubscription} from "http-cache-subscriptions";

const queue = new HttpFetchQueue({
    maxConcurrents: 1,
    maxAttempts: 1
});

const subscription = new HttpSubscription(queue,
    "JSON-FILE-URL",
    {
        maxInterval: 10000,
        minInterval: 1000,
        immediate: true,
        format: "json"
    }
);

subscription.subscribe({
    next: (result) => {
        console.log(result);
    },
    error: (error) => {
        console.error("ERR", error);
    }
});
0.0.3

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago