mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 09:41:33 +08:00
[next] Broadcast mutation events (#2083)
* feat: Implement mutation events * fix: correct testcase name
This commit is contained in:
@@ -27,13 +27,16 @@ function createMutationContainer<T extends string, I, R>(
|
||||
return compose(
|
||||
withContext(context => ({ context })),
|
||||
hoistStatics((BaseComponent: React.ComponentType<any>) => {
|
||||
class CreateMutationContainer extends React.Component<any> {
|
||||
class CreateMutationContainer extends React.Component<{
|
||||
context: TalkContext;
|
||||
}> {
|
||||
public static displayName = wrapDisplayName(
|
||||
BaseComponent,
|
||||
"createMutationContainer"
|
||||
);
|
||||
|
||||
private commit = (input: I) => {
|
||||
this.props.context.eventEmitter.emit(`mutation.${propName}`, input);
|
||||
return commit(
|
||||
this.props.context.relayEnvironment,
|
||||
input,
|
||||
|
||||
Reference in New Issue
Block a user