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 signupJourney = Machine( | |
{ | |
"key": "cart-abandoned", | |
"initial": "added_sneakers", | |
"states": { | |
"added_sneakers": { | |
"on": { | |
"DIDNT_BUY_SUPREME_ENTERED": "didnt_buy_supreme" | |
}, | |
"meta": { |
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
// The function runnning this code will be automatically provisioned when a user clicks the | |
// "create integration" button at the end of the creation flow -- it'll thread various bits | |
// of config down to the batch handler like profile -> destination mappings, auth tokens, and other | |
// context needed to interact with a partner api | |
async function onBatch(events, { endpoint, mappings, token }) { | |
//The mappings object is a dictionary of traitField->destinationField, lets retrieve all the | |
//traits we need from the profile api |
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
// 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
Visual Tagger | |
Initial* | |
create tag -> Tag Highlighting State | |
delete tag -> Delete Tag State | |
Delete Tag State | |
confirm -> Initial | |
cancel -> Initial |
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 * as React from 'react'; | |
// This is necessary so that when the extraData we're passing to ColumnDefinitions changes, | |
// the components actually update. Specifically, we want to update a line's adjustment, | |
// proposed amount, and percent change columns when the bulk adjustment is changed | |
const UpdateOnBulkAdjustmentPlugin = { | |
name: 'UpdateOnBulkAdjustmentPlugin', | |
components: { | |
TableBody: (InitialTableBody: typeof React.Component) => class extends InitialTableBody<any, any> { |
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
function co(genFunc) { | |
let genObj = genFunc(); | |
run(); | |
function run(promiseResult = undefined) { | |
let item = genObj.next(promiseResult); | |
if (!item.done) { | |
// A promise was yielded | |
item.value | |
.then(result => run(result)) |
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
(def dataset-schema [{:db/id #db/id [:db.part/db] | |
:db/ident :dataset/id | |
:db/valueType :db.type/uuid | |
:db/cardinality :db.cardinality/one | |
:db/unique :db.unique/identity | |
:db/index true | |
:db/doc "The globally unique id for a dataset" | |
:db.install/_attribute :db.part/db} | |
{:db/id #db/id [:db.part/db] | |
:db/ident :dataset/name |
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
function MergeLists(list1, list2) { | |
if (!list1) return list2; | |
if (!list2) return list1; | |
if (list1.data < list2.data) { | |
list1.next = MergeLists(list1.next, list2); | |
return list1; | |
} else { | |
list2.next = MergeLists(list2.next, list1); | |
return list2; |
NewerOlder