Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular ngrx/store…有没有办法获取正在使用的store slice的名称?_Angular_Ngrx - Fatal编程技术网

Angular ngrx/store…有没有办法获取正在使用的store slice的名称?

Angular ngrx/store…有没有办法获取正在使用的store slice的名称?,angular,ngrx,Angular,Ngrx,有没有办法从减速器内部获取正在使用的存储片(累加器)的名称 e、 g 我需要把钥匙“书”放在减书器里你为什么需要钥匙?reducer应该只看到与键相关的值;我想这是非常具体的,我正在创建一个动态服务,负责在存储中添加数据,与远程数据库同步,并处理脱机存储。服务在初始化时接收存储切片名称,其余部分自动完成。现在,我想将其与一个动态创建的reducer进行配对,该reducer具有基本的添加/更新/删除功能,但由于在调用dispatch时,所有reducer都会获取操作,因此我需要为操作添加前缀,即

有没有办法从减速器内部获取正在使用的存储片(累加器)的名称

e、 g


我需要把钥匙“书”放在减书器里

你为什么需要钥匙?reducer应该只看到与键相关的值;我想这是非常具体的,我正在创建一个动态服务,负责在存储中添加数据,与远程数据库同步,并处理脱机存储。服务在初始化时接收存储切片名称,其余部分自动完成。现在,我想将其与一个动态创建的reducer进行配对,该reducer具有基本的添加/更新/删除功能,但由于在调用dispatch时,所有reducer都会获取操作,因此我需要为操作添加前缀,即添加书籍或添加杂志,因此我需要能够从reducer中获取切片名称,将其用作前缀。
StoreModule.provideStore({
      books: BookReducer,
      magazines: MagazineReducer,
    })