
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
import ServiceLocator from 'trex.core/ServiceLocator';
const api = new ServiceLocator();
export enum Controllers {
App = 'IAppController',
Contacts = 'IContactsController',
Search = 'ISearchController',
AppFragments = 'IAppFragmentsController',
CreditCalculator = 'ICreditCalculatorController',
Weblogs = 'IWeblogController'
}
(function(api: ServiceLocator) {
api.bind<IAppController>(Controllers.App).to(new AppController());
api.bind<IContactsController>(Controllers.Contacts).to(new ContactsController());
api.bind<ISearchController>(Controllers.Search).to(new SearchController());
api.bind<IAppFragmentsController>(Controllers.AppFragments).to(new AppFragmentsController());
api.bind<ICreditCalculatorController>(Controllers.CreditCalculator).to(new CreditCalculatorController());
api.bind<IWeblogController>(Controllers.Weblogs).to(new WeblogController());
})(api);
export default api;
React Component Wrapper to support a reactive stream of props.
export default abstract class XHttpComponent<P, S extends IFragmentState, T> extends XComponent<P, S> {
private subscription: Subscription;
constructor(props: P) {
super(props);
}
componentDidMount() {
this.subscription = this.props$
.mergeMap(props => this.sourceData(props))
.map(httpBag => this.renderFragment(httpBag))
.subscribe(jsxFragment => {
this.setState({fragment: jsxFragment});
});
}
interface IProps{
}
class WeblogListWidget extends ReXHttpComponent<IProps, IFragmentState, Array<Weblog>> {
private readonly weblogController: IWeblogController = Api.get<IWeblogController>(Controllers.Weblogs);
constructor(props: IProps) {
super(props);
this.state = {
fragment: null
};
}
sourceData(props: IProps) {
return this.weblogController.list();
}
protected renderPending(): JSX.Element {
return (<span>Loading...</span>);
}
protected renderSucceeded(weblogs: Array<Weblog>): JSX.Element {
return (<article>
<header>Weblogs:</header>
<section>
{
weblogs.map(weblog => (
<article key={weblog.blogId}>
<header>{weblog.title}</header>
<section>
<p>{weblog.body}</p>
</section>
</article>
))
}
</section>
</article>);
}
protected renderFailed(error: HttpError): JSX.Element {
return <div>Failed!</div>
}
render(): JSX.Element {
return (
<article className="weblogs">
{this.state.fragment}
</article>
);
}
}
export default WeblogListWidget;
FAQs
<T>Rex Core Components
We found that trex.core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.