wox-team / wox-inject

React Dependency Injection library

Home Page:https://wox.so

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.





About

React Dependency Injection library

https://wox.so

License:MIT License


Languages

Language:TypeScript 81.7%Language:MDX 14.1%Language:JavaScript 2.9%Language:CSS 0.8%Language:HTML 0.5%