Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:24
    david-shortman commented #2222
  • 06:10
    david-shortman commented #2222
  • 06:09
    david-shortman commented #2222
  • 06:08
    david-shortman commented #2222
  • 06:03
    david-shortman commented #2757
  • 06:00
    david-shortman commented #2757
  • 05:50
    david-shortman commented #2757
  • 05:48
    david-shortman commented #2757
  • 05:47
    david-shortman commented #2757
  • 05:47
    david-shortman commented #2757
  • 05:45
    david-shortman edited #2757
  • 05:08
    timdeschryver closed #2757
  • 05:08
    timdeschryver commented #2757
  • 05:08
    timdeschryver labeled #2757
  • 04:51
    david-shortman opened #2757
  • 01:48
    ngrxbot commented #2756
  • 01:42
    markostanimirovic opened #2756
  • Oct 21 22:28
    StephenCooper commented #2754
  • Oct 21 22:27
    StephenCooper commented #2754
  • Oct 21 20:28
    e-davidson commented #2754
MatĆ­as Pizarro
@matias-pg_gitlab
@derekkite That sounds good, thanks man šŸ‘
nasreddine skandrani
@nasreddineskandrani
update: question on top
for example in ngrx-data the getWithQuery has a second parameter that has a MergeStrategy inside to be able to change the way the data is added
see y*
Derek
@derekkite
@nasreddineskandrani https://ngrx.io/guide/data/entity-metadata#entity-metadata when you create the entity you can please a sortComparer function
https://ngrx.io/guide/entity/adapter#createentityadaptert this is the underlying class that ngrx data used to store the sentries.
Neal van Veen
@Nvveen
Hi guys, if I have an endpoint that for every resource provides a resource/count endpoint, how can I extend @ngrx/data to create services s.t. I could do this.heroesService.getCount() and it would properly dispatch with a .../count action and add the count to the entity state? I'm pretty sure I know how to do this manually but I want to leverage @ngrx/data to do this for me as much as possible
Marko Stanimirović
@markostanimirovic

Hi everyone! I just released NgRx Handlers - A plugin for boilerplate elimination. I would appreciate if you check it out and let me know what you think :)

https://github.com/markostanimirovic/ngrx-handlers

matrixbot
@matrixbot
Andreas Weinzierl Interesting idea, but it somehow does not align with the best practice of actions representing events rather than commands:
E.g. the naming: [Component Name] Event
matrixbot
@matrixbot
Andreas Weinzierl I wonder if payload type checking is retained.
Marko Stanimirović
@markostanimirovic

Hi @matrixbot , thanks for the feedback.

  1. Naming convention [FeatureName] ActionName is used in official NgRx docs and because of that, action creators generated by NgRx handlers will have the types in that format. It looks nice when actions are pretty printed in store devtools :)

  2. Yep, action creators are strongly typed.

matrixbot
@matrixbot
Andreas Weinzierl 1. This was previously the case, but it is not anymore: https://ngrx.io/guide/store
Andreas Weinzierl 2. So you get a compiler error when using the wrong payload structure at dispatch?
Andreas Weinzierl * .2. So you get a compiler error when using the wrong payload structure at dispatch?
Marko Stanimirović
@markostanimirovic
Yes
Alex Okrushko
@alex-okrushko
Hey all,
Do we have any ngrx/data experts here?
We have a question at NgRx Discord about it - would appreciate if anyone can help https://discord.gg/DEhUEKU
Thanks
matrixbot
@matrixbot

Andreas Weinzierl > <@gitter_markostanimirovic:matrix.org> Yes

šŸ‘

Andreas Weinzierl > <@gitter_alex-okrushko:matrix.org> Hey all,

Do we have any ngrx/data experts here?
We have a question at NgRx Discord about it - would appreciate if anyone can help https://discord.gg/DEhUEKU
Thanks

What's the question?

Carlos Esteban Lopez Jaramillo
@luchillo17
Hi, I'm trying to test a component that gets data from the store, I have a StateModule that contains the StoreModule.forRoot(...), however using this module in the test bed config doesn't work
image.png
However using the forRoot directly in place of that does work and test passes, why importing the StateModule doesn't work?
image.png
nasreddine skandrani
@nasreddineskandrani
@derekkite thanks derek i'll take a look at it.
nasreddine skandrani
@nasreddineskandrani
@luchillo17 use MockStore
if you want help the best way it's to simulate the problem in a github public repo. of yours or directly on https://stackblitz.com/
than i am sure a lot of members of this gitter can help you solve it
SAGO
@SAGOlab
Hi there, How can I update a data in a component without refresh page?
Matt Erman
@CodeLiftSleep
So I am having an issue where the the ngRx store goes into an endless loop when inside a route guard, which was supposed to be fixed 3 years ago, but seems to be happening again after the new release...
Any workaround known to this?
SAGO
@SAGOlab
Hi there, How can I update a data in a component without refresh page?
Shlomi Levi
@wizardnet972
Hi, How to get by id entity form the server? I have only: getAll, getByKey, getByQuery. the getByKey('blabla') call to /api/product/blabla. the REST say api/products/1 for retrieve one item. why its different or it for some other purpose?
suraj singh
@baghel95
The entity passed to the selectId implementation returned undefined. You should probably provide your own selectId implementation. The entity that was passed:
how to fix
Magnus Grindal Bakken
@magnusbakken

Hello!

I've been using ngrx for a while, but I'm looking into using @ngrx/data for a new system module. Our REST API for this module consists of a single operation that retrieves all data at once, and a single save operation containing lists of creates, updates and deletes. I've gathered that I should be using the EntityCacheDispatcher described at https://ngrx.io/guide/data/save-entities.

I have two questions:

  1. The data the API expects is very similar to the ChangeSet structure, but needs to be customized slightly. What is the correct place to transform the ChangeSet?
  2. How do I make the ChangeSet that EntityCacheDispatcher expects as its input? I would like to combine the saveEntities feature with the automatic change tracking, so in my mind I should just be able to pass all the currently cached change operations in the store. How do I get the data out of the store and into the EntityCacheDispatcher call?
Mohi šŸ¦€
@mohijalili_twitter

Hi Guys.

How to remove all the states on logout in ngrx/store?

export function clearState(reducer) {
  return function(state, action) {
    if (action.type ===  Auth.Logout) {
      return reducer({}, action);
    }

    return reducer(state, action);
  };
}

    StoreModule.forRoot(
      {},
      {
        runtimeChecks: {
          strictStateImmutability: true,
          strictActionImmutability: true
        },
        metaReducers: [...metaReducers, clearState]
      }
    ),

it will reset all data not remove.

matrixbot
@matrixbot
Andreas Weinzierl What is the difference between reset and remove?
1 reply
Derek
@derekkite
@mohijalili_twitter action.type is a string, is Auth.Logout a string?
1 reply
you might want Auth.Logout.type
Derek
@derekkite
export function clearState(reducer) {
    if (action.type ===  Auth.Logout) {
      state = {}  // or default state
    }
    return reducer(state, action);
  };
}
1 reply
@mohijalili_twitter
Pascal Betting
@pascalbe-dev
Hi guys,
has anyone implemented a file download (via angular http client ) with ngrx? I'm wondering, if I can / should save the Blob or a generated ObjectUrl to the state in order to download it inside the component. Or should I run the download within the effect and just store the a flag, wether something is currently downloading to the state? Does anyone have an idea?
matrixbot
@matrixbot
Andreas Weinzierl Pascal Betting (Gitter): more Infos required
Andreas Weinzierl Is it better to emit events indicating errors in the service (where they happen) or in the effect (where they would be unrelated to the specific effect)?
Shlomi Levi
@wizardnet972
I have Product entity in @ngrx/data.
When I invoke: prodcutService.getByKey(1) -> it call to /api/product/1 instead of /api/products/1. why getByKey is not call in plural? should be /api/products/1. (products, not product).
this is bug?
Neal van Veen
@Nvveen
Hi guys, does anyone know how to disable caching in the @ngrx/data? EntityCollectionService.load() seems to be the only method that replaces results in the cache, but I need to call load with query parameters.
Adamicov
@Adamicov
Hi guys, someone had this kind of error after updating ngrx to 10? ERROR Error: Uncaught (in promise): TypeError: can't define property "__NG_ELEMENT_ID__": Function is not extensible bloomAdd@http://localhost:4200/vendor.js:38331:9 diPublicInInjector@http://localhost:4200/vendor.js:38473:13 createRootComponentView@http://localhost:4200/vendor.js:48045:27 create@http://localhost:4200/vendor.js:56780:58 createComponent@http://localhost:4200/vendor.js:44724:55 activateWith@http://localhost:4200/vendor.js:112917:40
ERROR Error: Uncaught (in promise): TypeError: can't define property "__NG_ELEMENT_ID__": Function is not extensible
bloomAdd@http://localhost:4200/vendor.js:38331:9
diPublicInInjector@http://localhost:4200/vendor.js:38473:13
createRootComponentView@http://localhost:4200/vendor.js:48045:27
create@http://localhost:4200/vendor.js:56780:58
createComponent@http://localhost:4200/vendor.js:44724:55
activateWith@http://localhost:4200/vendor.js:112917:40