Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 26 2016 19:45
    guilhermeaiolfi commented #322
  • Apr 26 2016 19:33
    k2s commented #322
  • Apr 26 2016 19:28
    jmdobry commented #322
  • Apr 26 2016 19:13
    k2s commented #322
  • Apr 26 2016 19:07
    guilhermeaiolfi commented #322
  • Apr 26 2016 12:12
    k2s opened #322
  • Apr 26 2016 04:36
    jmdobry synchronize #264
  • Apr 26 2016 04:36

    jmdobry on v3

    Improved JSDocs (compare)

  • Apr 24 2016 17:53
    remicastaing commented #321
  • Apr 24 2016 17:53
    remicastaing closed #321
  • Apr 24 2016 17:35
    jmdobry labeled #321
  • Apr 24 2016 17:35
    jmdobry commented #321
  • Apr 24 2016 14:23
    remicastaing opened #321
  • Apr 23 2016 22:57
    jmdobry synchronize #264
  • Apr 23 2016 22:57

    jmdobry on v3

    Improved JSDocs (compare)

  • Apr 23 2016 08:19
    jmdobry synchronize #264
  • Apr 23 2016 08:19

    jmdobry on v3

    Improved JSDocs (compare)

  • Apr 22 2016 08:41
    jmdobry edited #320
  • Apr 22 2016 08:41
    georgi-kovachev closed #320
  • Apr 22 2016 08:41
    georgi-kovachev commented #320
Grégory Copin
@Gregcop1
then with react-thunk or saga, you will be able to make some async change to your store (by calling your resources)
panigrah
@panigrah
The slack Channel is a little more active but not by much
Sisir
@prionkor
Hey
I am trying to work with http adapter afterHTTP hook
adapter.afterHTTP = (config, opts, response) => {
    console.log('after http');
    console.log(response.status);
    if(response.status === 401){
        //dispatch('CLEAR_SESSION');


    }
    return HttpAdapter.prototype.afterHTTP.call(this, config, opts, response);
}
but it is not firing..
Sisir
@prionkor
@panigrah What is the address for slack channel?
panigrah
@panigrah
@prionkor js-data.slack.com
Sisir
@prionkor
does it requires invitation? I don't understand slack.. :-/
Sisir
@prionkor
got the afterHTTP work..
Sisir
@prionkor
@Gregcop1 I have little confusion on data-js schema definition. For example take a look at this model.
{
        name: 'article',
        options: {
            endpoint: 'articles',
            relations: {
                belongsTo: {
                    user: {
                        foreignKey: 'user_id',
                        localField: 'user'
                    }
                }
            },
            schema: {
                title: 'Article',
                type: 'object',
                properties: {
                    id: number,
                    user_id: {type: 'number', indexed: true},
                    content: array,
                    parent: {type: ['number', 'null']},
                    created_at: string,
                    updated_at: string
                }
            }
        }
    }
the parent is an article id. Do I need to set it as indexed?
In my app can js data automatically pulls the parent article? So I can reference like this. article.parent.user_id (off course I will have to check for null).
Grégory Copin
@Gregcop1
Hi, I'm sorry but I don't have laptops near me this weekend so I can't make test
IMHO, you have two solution
Ask your API to send embed object and save them in js-data in dumb object (a same parent will be duplicated in all object
Sisir
@prionkor
I am sorry, totally forgot today was saturday..
Grégory Copin
@Gregcop1
The other solution is to use some kind of interceptor and when you receive a bunch of articles, the interceptor parse response and make new subrequest for all parents but it consume a lot of bandwidth if you have a lot of different parents
No problem 😋
Sisir
@prionkor
server side solution seems better idea..
as I will only return the parent object in the single resource /article/{id}
Grégory Copin
@Gregcop1
Agreed
Sisir
@prionkor
but probably the interception isn't a bad idea If can be implemented only for single resource endpoint. besides if I already have the aritlce on memory I it can referenced from there..
Grégory Copin
@Gregcop1
When we used this, we passed a custom option to queries (nested: "nameOfField") to build subrequest on this field if the option is set
Sisir
@prionkor
so server side only respond for the given field.
have a nice weekend. I will manage through the weekend. no more mentioning you. I will keep this chatbox updated. So, if you have time you could check it asynchronously. Thanks again for your great help!
Grégory Copin
@Gregcop1
Ok, no problem. I hope you'll find the best solution for your project
Sisir
@prionkor
did you face this issue? When I get data using findAll() it return data from REST api but on the next query because previous query is cashed it doesn't send api request but doesn’t return the data from cache either. it returns empty array
Sisir
@prionkor
How do I get non resource data. For example I have homepage of the application where I need a bunch of data like uses stat, total numbers of blog posts etc.. those information aren't like resources (articles, users etc). How do I make those enpoints? For example /dashboard-data
Grégory Copin
@Gregcop1
Hi
Do you need those data to be stored on cache ?
do you really need js-data for that ?
Sisir
@prionkor
my main goal was to find a data layer that manages my data from server, caches appropriate
to reduce redundant request
the json schema in js data is a good feature
Grégory Copin
@Gregcop1
that's why at first I was asking you if all your endpoint are restFull
In my apps, I manage everything with Resources (which extend an AbstractResource)
those resources are instanciate with some options (use cache, cache lifetime, etc...) and instanciate js-data resource when needed of make direct GET call via axios for non-restFul request
Sisir
@prionkor
I am creating backend api as I move forward so if anything needs to be created I am okay with that
Sisir
@prionkor
my immediate problem is to solve the empty data return form js-data. for example store.findAll('article', {_limit: 50, _offset:0}) calls server first time but on second time it doesn't call the server and returns empty array []
Grégory Copin
@Gregcop1
Mmm I never had this problem
Have you checked your indexeddb/localstorage (dunno where you store your cache) to watch if data are stored after the first call ?
Sisir
@prionkor
not using any kind of storage. Its storing in the variable (RAM)
Grégory Copin
@Gregcop1
ok, so you should be able to watch store state in the console of your browser
you have some example in the doc of jsdata
Sisir
@prionkor
let me check
got it..
I will get back to you soon
Grégory Copin
@Gregcop1
ok