djinn-state-react
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,5 +1,5 @@ | ||
import { Djinn, DjinnService } from 'djinn-state'; | ||
import React from 'react'; | ||
import { Djinn, DjinnService } from 'djinn-state'; | ||
import { ServicesDescription, ServiceStateMapping } from './types'; | ||
declare type Props = { | ||
interface IProps { | ||
djinn: Djinn; | ||
@@ -10,4 +10,4 @@ services: ServicesDescription; | ||
props?: any; | ||
}; | ||
export declare class DjinnConnection extends React.Component<Props> { | ||
} | ||
export declare class DjinnConnection extends React.Component<IProps> { | ||
state: {}; | ||
@@ -18,3 +18,3 @@ services: { | ||
private __subscriptions; | ||
componentDidMount(): void; | ||
componentWillMount(): void; | ||
componentWillUnmount(): void; | ||
@@ -21,0 +21,0 @@ updateState: (service: string) => (state: any) => void; |
@@ -50,6 +50,9 @@ "use strict"; | ||
} | ||
DjinnConnection.prototype.componentDidMount = function () { | ||
DjinnConnection.prototype.componentWillMount = function () { | ||
var _a = this.props, djinn = _a.djinn, services = _a.services; | ||
var state = {}; | ||
for (var key in services) { | ||
if (!services.hasOwnProperty(key)) { | ||
continue; | ||
} | ||
this.services[key] = djinn.getService(services[key]); | ||
@@ -66,2 +69,5 @@ if (this.services[key]) { | ||
for (var key in services) { | ||
if (!services.hasOwnProperty(key)) { | ||
continue; | ||
} | ||
this.__subscriptions[key](); | ||
@@ -68,0 +74,0 @@ } |
{ | ||
"name": "djinn-state-react", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "djinn-state helpers for react", | ||
@@ -9,2 +9,12 @@ "main": "dist/index.js", | ||
"license": "MIT", | ||
"keywords": [ | ||
"javascript", | ||
"typescript", | ||
"nodejs", | ||
"browser", | ||
"application-state", | ||
"state-management", | ||
"services", | ||
"react" | ||
], | ||
"scripts": { | ||
@@ -11,0 +21,0 @@ "test": "jest", |
import { Djinn } from 'djinn-state'; | ||
import { djinnConnector } from './djinnConnector'; | ||
import { ServicesDescription, ServiceStateMapping } from './types'; | ||
import { djinnConnector } from './djinnConnector'; | ||
@@ -5,0 +5,0 @@ export const createDjinnConnector = (djinn: Djinn) => |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21500
406