I'm new to reactjs. I want to know Is there an equivalent for angular services such as $rootScop
, $q
, $webSocket
, ... in reactJs?
.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.