Skip to content

Commit

Permalink
💡 Updated eventEmitter comments with links
Browse files Browse the repository at this point in the history
  • Loading branch information
Etesam913 committed Aug 3, 2022
1 parent d65b46c commit 0d5086c
Show file tree
Hide file tree
Showing 5 changed files with 2,868 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function SubmitFrame({ children, onSubmit, currentTask }) {
React.useEffect(() => {
// Reset submitting when switching from onboarding
setSubmitting(false);
}, []);
}, [currentTask]);

function handleFormSubmit(event) {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { useState, useCallback, useEffect } from "react";

/**
* This hook is to be used with events that are supposed to update state when they are consumed.
* @param {string} eventName
* @param {string} configName
* @param {any} defaultValue
* @param {function} validatorFunction
* @returns [any any]
*/
export function useMephistoGlobalConfig(
eventName,
configName,
defaultValue,
validatorFunction
) {
Expand All @@ -26,7 +26,7 @@ export function useMephistoGlobalConfig(
);

useEffect(() => {
window._MEPHISTO_CONFIG_.EVENT_EMITTER.on(eventName, handleEvent);
window._MEPHISTO_CONFIG_.EVENT_EMITTER.on(configName, handleEvent);
}, [setConfigState]);

return [configState, setConfigState];
Expand Down
Loading

0 comments on commit 0d5086c

Please sign in to comment.