Wox Inject empowers React apps with a versatile dependency injection library, promoting an alternative paradigm to handle complexity.
import { Injectable } from '@wox-team/wox-inject';
@Injectable()
class GreeterService {
greet(val: string) {
console.log(val);
}
}
function App() {
const greeterService = useResolve(GreeterService);
return (
<button type="button" onClick={() => greeterService.greet('hello!')}>click me</button>
);
}
Visit wox.so to get started with Wox Inject.
Right now the focus is to provide stability for SPA usage. SSR will be on the roadmap.
Want to contribute to wox inject? Our contributing guide has you covered.