Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am udfalkso on github.
  • I am udi (https://keybase.io/udi) on keybase.
  • I have a public key ASClxDVn_3eZwSvlFp5FKDgWlWQfpXQlxjiQY2xRq32-0Qo

To claim this, I am signing this object:

@udfalkso
udfalkso / App.js
Last active April 6, 2018 12:16
"Portal" style modal that transfers content elsewhere without native code
import ModalManager from "app/lib/ModalManager"
import styles from "./styles"
import React from "react"
import ReactNative from "react-native"
import { connect } from "react-redux"
const { StatusBar, View, StyleSheet, Platform } = ReactNative
class AppModal extends React.Component {
@udfalkso
udfalkso / takeLatestPerActionAttr.js
Created September 23, 2019 20:45
redux saga takeLatestPerActionAttr more specific takeLatest
/*
* Custom variant on redux saga's takeLatest that allows us to resolve race condition for data updates
* based on something more specific than just the action type.
* This accepts an action type (e.g. FETCH_DATA) as well as a fn that that extracts a value from the action
* itself. (e.g. (a) => a.module.id) to get action attribute value. We can then effectively do a takeLatest for the action+value
* combination and ensure that only the latest action for each combo isn't cancelled.
* */
export const takeLatestPerActionAttr = (actionType, attrFn, saga, ...args) =>
fork(function*() {
const lastTasks = {}