react-native-navigation
Version:
React Native Navigation - truly native navigation for iOS and Android
18 lines (14 loc) • 635 B
text/typescript
import { LayoutProcessorsStore } from './LayoutProcessorsStore';
import { LayoutProcessor as ILayoutProcessor } from '../interfaces/Processors';
import { Layout } from '../interfaces/Layout';
import { CommandName } from '../interfaces/CommandName';
export class LayoutProcessor {
constructor(private layoutProcessorsStore: LayoutProcessorsStore) {}
public process(layout: Layout<any>, commandName: CommandName): Layout {
const processors: ILayoutProcessor[] = this.layoutProcessorsStore.getProcessors();
processors.forEach((processor) => {
layout = processor(layout, commandName);
});
return layout;
}
}