Skip to content

wox-team/wox-inject

Repository files navigation

An open source Dependency Injection library.



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>
  );
}

Getting Started

Visit wox.so to get started with Wox Inject.


What about SSR?

Right now the focus is to provide stability for SPA usage. SSR will be on the roadmap.


Contributing

Want to contribute to wox inject? Our contributing guide has you covered.