Concept
Read through this chapter in order to understand our way of thinking and coming up with @ng-frrri/router-middleware.
1. States registry
Synopsis
import { StatesRegistryService } from './states-registry.service';
const statesRegistry = new StatesRegistryService();
const notesFacade = statesRegistry.getByPath<'notes'>('entities.notes');
const usersFacade = statesRegistry.getByPath<'users'>('entities.users');
console.log(notesFacade.getOne(1));
// outputs: { id: 1, title: "Note #1", userId: 1 }
console.log(usersFacade.getOne(1));
// outputs: { id: 1, name: "Josef" }const applicationState = {
entities: {
notes: {
entities: {
1: {
id: 1,
title: 'Note #1',
userId: 1,
},
3: {
id: 3,
title: 'Note #3',
userId: 2,
},
},
ids: [1, 3],
},
users: {
entities: {
1: {
id: 1,
name: 'Josef',
},
2: {
id: 2,
name: 'Sarah',
},
},
ids: [1, 2],
},
},
};
const statesRegistry = new StatesRegistryService();
const notesFacade = statesRegistry.getByPath<'notes'>('entities.notes');
console.log(notesFacade.getOne(1));What are the benefits?
1.1. Smart-ui
1.2. Router middleware
2. Router middleware
2.1. Operators
2.2. Platforms
2.3. Middlewares
Last updated