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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// ==UserScript== | |
// @name SharePoint Rest API Formatter | |
// @namespace Portals Dev | |
// @match https://*.sharepoint.com/*_api/* | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description 4/19/2020, 2:19:16 PM | |
// ==/UserScript== |
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 machine = Machine({ | |
id: 'milkSourceMileageCollection', | |
initial: 'OPEN', | |
states: { | |
OPEN: { | |
on: { | |
"sumbit:mileage": "SUBMITTED", | |
"notify:transfer": 'TRANSFER_NEEDED' | |
} | |
}, |
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
let _activeIndexingId = ""; | |
let _activeQueryId = ""; | |
const indexingMachine = Machine({ | |
id: 'indexer', | |
initial: "QUERYING", | |
states: { | |
IDLE: { | |
on: { |
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
PinPoint | |
Loading* | |
onload -> Idle | |
onerror -> Error | |
Syncing | |
onload -> Idle | |
onerror -> Error | |
Idle | |
refine -> Loading | |
refresh -> Syncing |
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 { useEffect, useState } from "react"; | |
import usePaging from "./usePaging"; | |
import useHover from "./useHover"; | |
import useInterval from "./useInterval"; | |
export default function useAutoPaging( | |
totalPages: number, | |
delay = 5000, | |
defaultPage = 1 | |
) { |
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 { useState, useRef, useEffect } from "react"; | |
export default function useHover() { | |
const [isHovered, setIsHovered] = useState(false); | |
const hoverRef = useRef(null); | |
const handleMouseOver = () => setIsHovered(true); | |
const handleMouseOut = () => setIsHovered(false); |
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 { useRef, useEffect } from "react"; | |
export default function useInterval(callback, delay) { | |
const savedCallback = useRef(null); | |
useEffect(() => { | |
savedCallback.current = callback; | |
}); | |
useEffect( |
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 { useState } from "react"; | |
export default function usePaging(totalPages: number, defaultPage = 1) { | |
let [currentPage, setCurrentPage] = useState(defaultPage); | |
let goBack = () => { | |
let newPage = currentPage - 1; | |
if (newPage < 1) newPage = totalPages; | |
setCurrentPage(newPage); | |
}; |
NewerOlder