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 m = Machine({ | |
| initial: 'wejscie', | |
| states: { | |
| 'wejscie': { | |
| on: { | |
| '': [ | |
| { target: 'sprawdzenie', cond: 'jest na sg b2b albo b2c' }, | |
| { target: 'koniec' } |
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 Options = { | |
| actions: { | |
| setContent: "setContent", | |
| setGroups: "setGroups", | |
| setSelectedType: "setSelectedType", | |
| setOnlyType: "setOnlyType", | |
| setSelectedUpsellOffer: "setSelectedUpsellOffer" | |
| }, | |
| services: { | |
| loadData: "loadData", |
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 Options = { | |
| actions: { | |
| setErrorInfo: "setErrorInfo", | |
| setInitializingData: "setInitializingData", | |
| setOfferTypeGroup: "setOfferTypeGroup", | |
| setOfferType: "setOfferType", | |
| setProcedure: "setProcedure", | |
| setOffer: "setOffer", | |
| setShouldAddAnotherDevice: "setShouldAddAnotherDevice", | |
| setSelectedProcesableContract: "setSelectedProcesableContract", |
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
| /** | |
| * wybierz = actions.choose([{ | |
| cond: 'isPhone', | |
| target: 'phone' | |
| },{ | |
| cond: 'isPesel', | |
| target: 'pesel' | |
| }, { | |
| cond: 'isEmail', | |
| target: 'email' |
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 button = Machine({ | |
| id: "button", | |
| type: "parallel", | |
| states: { | |
| size: { | |
| initial: "small", | |
| states: { | |
| small: {}, | |
| big: {}, | |
| }, |
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
| Machine({ | |
| id: 'foo', | |
| initial: "load", | |
| states: { | |
| load: { | |
| invoke: { | |
| src: () => Promise.resolve(Math.random()), | |
| onDone: [{ | |
| target: 'ok', | |
| cond: (_, e) => e.data > 0.5 |
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
| import NextAuth, { type NextAuthOptions } from "next-auth"; | |
| import { JWT } from "next-auth/jwt"; | |
| import * as jwt from "jose"; | |
| export const authOptions: NextAuthOptions = { | |
| // the rest is just like in tutorials. Session, callbacks etc. | |
| jwt: { | |
| encode: async ({ secret, token }) => { | |
| if (!token) { | |
| console.warn("encode: No token provided"); |
OlderNewer