One said:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
The question - how he will find you?
You can use react-traceback for analytics, understanding position in the tree, all the things...
Usage
;; // Mark markupconst MyForm = <Form> <Breadcrumb crumb="section1"> ... </Breadcrumb> <Breadcrumb crumb="submit"> <Button /> </Breadcrumb> </Form>; // Mark componentconst MarkedComponent = MyComponent // Enhance component with backtrace function { thisprops; }; // Store some information by the way InternalComponent; // Connect to the outer APIApplication
API
- Breadcrumb - leaves a crumb behind
- (HOC)leaveBreadcrumb(crumb:string)(Component) - is a HOC for the same sake.
- (HOC)withBreadcrumb(Component) - provision a Component with backtrace function
- (HOC)addSpices(function)(Component) - allows you to modify payload by the way
- (HOC)connectBacktrace(function)(Component) - connects to the top-level API
Composition
connectBacktrace
is the start, and is the end for a breadcrumb.
const NextComponent = ; const Middleware = NextComponent;