exilz / apipeline Goto Github PK
View Code? Open in Web Editor NEWFeature-rich and pluggable offline-first API wrapper for all your javascript environements ! Easily wire-up your API and make your app work offline in minutes.
Feature-rich and pluggable offline-first API wrapper for all your javascript environements ! Easily wire-up your API and make your app work offline in minutes.
I want to add some fields in body by middleware to each request, but merger ignores new body
export default async function middleware() {
return {
body: 'exampleText',
};
// I tried return { fetchOptions: { body: 'exampleBody'}} also
}
}
HTTP2 PUSH + offline API makes a good combo in RESTful, Hypermedia-style APIs. So I wondered if your library would listen for HTTP2 PUSH promises and store the responses ?
Hi! I'm trying to fetch data that does not return JSON, but rather returns RSS format. It returns an error:
[Error: SyntaxError: JSON Parse error: Unrecognized token '<']
Any help / alternative would be nice. Thanks!
Hi,
In the fetch method response data not having header status like 200, 400 ...etc
I need both the header status and data in my use-case.
How to get this header status in the response.
Thanks
I'm trying to find a way to invalidate cache for an individual item which looks like is not possible at the moment. For example if I have an api like:
const API = {
user: {
path: 'user/:userId'
}
}
When I call api.get('user', {pathParameters: {userId: 'user1'}})
it will cache the response for user1
. But at some point if user1
is updated and I want to invalidate cache only for user1
there is no way, I would have to clear the cache for all the users with clearCache('user')
, if I understant correctly. Now I see that api.get()
also allows you to override disableCache
for a particular call. So technically I can re-fetch user1
with api.get('user', {pathParameters: {userId: 'user1'}, disableCache: true })
and get the latest values for user1
.
I was assuming that the api would now update the existing cache for user1
to the latest value that it received in the seconds call. But looks like it doesn't. It would be neat if that was the case! Ootherwise next time I call api.get
for user1
without disableCache again, I would be getting older version of the user that was returned in the first call.
I can shoot a PR if you think this makes sense to have.
Hi,
I'm getting API Data expiration time from API Response Header, So after calling the fetch method only i know the expiration time, So now i want set this time to cache expiration.
Please help me how to set cache expiration time after calling fetch menthod.
Great package! How can I know if the response i get from the api call is cache data or real data?
Why there is no PATCH method in supported methods? And how can i make PATCH request in react native app using apipipeline?
currently I can' find a way to apply global Headers
I have to apply it per service/request , or I'm missing something here?
Hi @Exilz,
Any plan to support GraphQL in apippeline?
I was wondering looking at the flowchart how the caching data is checked for stale state ?
Hi I'm using https://github.com/tiaanduplessis/tenacious-fetch and I think it's a good idea if we can support retry fetch here in react-native-offline-api.
@Exilz Are you agree?
Hello
my app is crash and close after calling "OPEN database: apipeline.db"
this is log
01-20 08:50:25.864 29083 29120 I ReactNativeJS: 'Setting debug to:', false
01-20 08:50:25.865 29083 29120 I ReactNativeJS: Promise based runtime ready
01-20 08:50:25.866 29083 29120 I ReactNativeJS: OPEN database: apipeline.db
01-20 08:50:25.991 29083 29120 I ReactNativeJS: Running application "000000" with appParams: {"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
any help ?
thnx
Hi,
I am using Promise.all() method for multiple api request.
e.g
Promise.all(['http://url1.com/api', 'http://url1.com/api2']);
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
How to implement this functionality in offlineapi.
Thanks in Advance.
when rawData
is true , it caches the response with response including the data
as promise , so when retrieving it from the cache , the json
method won't work.
any suggestions ?
Is it possible to add ability to process response through middlewares?
In many cases, I need to handle http status code or reformat the response body, and I'd like to write a middleware for these purposes.
Hi,
I need to post raw JSON data in fetch api without using JSON.stringify() in body.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.