Created
March 16, 2018 17:16
-
-
Save sazzer/cc26caaf61ccc5216049f2d04e2e6aa1 to your computer and use it in GitHub Desktop.
Can Unstateful Containers see each other?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type LoginProvidersState = { | |
+loadedState: string, | |
+providers: { | |
[key: string]: string | |
} | |
}; | |
export class LoginProvidersContainer extends Container<LoginProvidersState> { | |
state = { | |
loadedState: PENDING, | |
providers: {} // This is a map of Provider ID onto a URI to start authentication | |
}; | |
// More code in here | |
} | |
type AccessToken = { | |
+token: string, | |
+expires: string | |
}; | |
type AccessTokenState = { | |
+token: ?AccessToken | |
}; | |
export class AccessTokenContainer extends Container<AccessTokenState> { | |
state = {}; | |
async authenticate(provider) { | |
// Can this get the Authentication URI from the LoginProvidersContainer? | |
// Or must it be that the calling code looks it up in one Container and provides it to the other? | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment