I'm new to reactjs. I want to know, is there an equivalent for angular services such as $rootScop
, $q
, $webSocket
in reactJs?
code:
.service('a', function ($rootScope, $location, $q, $webSocket) {
this.init = function () {
b()
c()
}
For example code parameters above what equivalent in react? I know the equivalent $scope
in react is this.state
.