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
import ReactExampleWidget from "reactexample/Widget"; |
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
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin"); | |
module.exports = { | |
mode: "development", | |
devServer: { | |
port: 8080, | |
}, | |
plugins: [ | |
new ModuleFederationPlugin({ | |
name: "container", |
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
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin"); | |
module.exports = { | |
entry: "./src/index", | |
mode: "development", | |
devServer: { | |
port: 8081, | |
}, | |
plugins: [ |
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
[ | |
"code janitor", | |
"crack", | |
["djinn", "jinniyah"], | |
"engineer", | |
"expert", | |
"freddy mercury of code", | |
"full time nerd", | |
"fullstack developer", | |
"genie", |
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
const fetchUserEpic = (action$: ActionsObservable<UserActionTypes>) => | |
action$.pipe( | |
ofType(FETCH_USER_REQUEST), | |
switchMap(() => | |
from(API.fetch()).pipe( | |
mergeMap(data => of(setUserInfo(data))), | |
catchError(() => of(unsetUserInfo())) | |
) | |
) | |
); |
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
import { SET_USER, SET_USER_TOKEN, UNSET_USER, UserActionTypes } from './types'; | |
import { User } from './types'; | |
const initialState: User = { | |
id: null, | |
name: '', | |
email: '', | |
}; | |
function userInfo(state = initialState, action: UserActionTypes): User { |
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
export const SET_USER_TOKEN = 'SET_USER_TOKEN'; | |
export interface SetUserTokenAction { | |
type: typeof SET_USER_TOKEN; | |
payload: string; | |
} | |
export type UserActionTypes = | |
| SetUserTokenAction | |
| ActionB // other action |
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
import { | |
SET_USER_TOKEN, | |
SetUserTokenAction, | |
} from './types'; | |
import { simpleAction } from '../utils'; | |
export const setUserToken = (token: string): SetUserTokenAction => | |
simpleAction(SET_USER_TOKEN, token); |
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
import React from 'react'; | |
import { Animated } from 'react-native'; | |
const PanExample = () => { | |
const panResponder = PanResponder.create({ | |
onStartShouldSetPanResponder: () => true, // we are enabling pan responder on start with this. So now we can listen tap and move | |
onPanResponderMove: (evt, gestureState) => { | |
// here we are listening every move | |
// evt and gestureState simply returns the x,y of the movement position | |
console.log('yes we are moving', gestureState.dy, gestureState.dx); |
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
import { from, of, concat } from 'rxjs'; | |
import { catchError, mergeMap, switchMap, takeUntil } from 'rxjs/operators'; | |
import { startSubmit, stopSubmit } from 'redux-form'; | |
const exampleEpic = action$ => | |
action$.pipe( | |
ofType(types.ACTION_REQUEST), | |
switchMap(({ payload, meta }) => // yes, meta! | |
concat( | |
of(startSubmit(meta.formName)), // Here we define that this specific form is submitting |
NewerOlder