This file contains hidden or 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
| let widgetSettingsMachine = Machine({ | |
| id: 'widgetSettings', | |
| context: {}, | |
| type: "parallel", | |
| states: { | |
| general: { | |
| on: { | |
| CHANGE_NAME: { | |
| actions: "updateName" | |
| }, |
This file contains hidden or 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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or 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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or 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
| const fetchMachine = Machine({ | |
| id: "approvals", | |
| context: { | |
| page: 0, | |
| results: [], | |
| selectedIds: {}, | |
| error: null | |
| }, | |
| type: "parallel", | |
| states: { |
This file contains hidden or 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
| let approvalsMachine = Machine( | |
| { | |
| id: "approvals", | |
| context: { | |
| dateStart: "", | |
| dateEnd: "", | |
| page: 0, | |
| results: [], | |
| items: {}, | |
| error: null |
This file contains hidden or 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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or 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
| function Col({ | |
| as = "div", | |
| justifyContent, | |
| alignItems, | |
| flex, | |
| children | |
| }) { | |
| return createElement(as, { | |
| className: css({ | |
| display: "flex", |
This file contains hidden or 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
| function Spacer({ size }) { | |
| return ( | |
| <span | |
| className={css({ | |
| display: "block", | |
| width: `var(--spacing-${size})`, | |
| height: `var(--spacing-${size})` | |
| })} | |
| aria-hidden | |
| /> |
This file contains hidden or 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
| // Good | |
| let { parameters, customParameters } = connection; | |
| let firstName = customParameters.get("FirstName"); | |
| let lastName = customParameters.get("LastName"); | |
| // Lets say we now need to pass eventId. | |
| // One could easily add it inside caller as it | |
| // already has multiple props, and things are a bit |
This file contains hidden or 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
| // This code handles complexity higher in the tree. | |
| // | |
| // It makes higher-level components more complicated, but the whole | |
| // rendering logic is contained in a single place, which might | |
| // help long-term maintenance. | |
| function Call() { | |
| let { state, send } = useContext(TelecomContext); | |
| let { caller } = state.context; |