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
<LabeledTextAreaInput lens="CONTACT_DETAILS" | |
formAtom={ formAtom } | |
{ ...props.opportunity } | |
/> | |
<LabeledTextAreaInput lens={ [ 'path', 'to', 'CONTACT_DETAILS' ] } | |
formAtom={ formAtom } | |
validAtom={ validAtom } | |
disabled={ disabled } | |
/> |
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
// View the lensToLabel function in the partial.lenses playground at https://goo.gl/A0BRWa | |
import * as R from "ramda" | |
import * as L from "partial.lenses" | |
import * as React from "karet" | |
import * as U from "karet.util" | |
import TextInput from "./text-input" | |
const uCFirst = |
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 makeQuery = | |
U.pipe( U.template | |
, U.flatMapLatest( L.get( [ 0, U.pipe( Req.withParams( url ), Req.getJSON ) ] ) ) | |
) | |
const getItem = | |
U.view( [ 'response', 'body', L.define( {} ) ] ) | |
export const Edit = | |
U.withContext( |
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
// REPL: https://calmm-js.github.io/partial.lenses/playground.html | |
// discussion: https://gitter.im/calmm-js/chat?at=58ecf9c6bdf4acc1124c504f | |
const list = | |
{ | |
tasks: [ { id: 2 | |
, state: 'todo' | |
, users: [ { id: 1 } ] | |
} | |
, { id: 2 | |
, state: 'todo' |
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
// REPL: https://calmm-js.github.io/partial.lenses/playground.html | |
// setup | |
const list = [ { uuid: 1, v: 1 }, { uuid: 2, v: 2 } ] | |
// lenses | |
const byPropNameL = R.curry( propName => R.compose( L.find, R.propEq( propName ) ) ) | |
const byUuidL = byPropNameL( 'uuid' ) | |
// getters & setters | |
const getByUuid = R.curry( ( uuid, o ) => L.get( byUuidL( uuid ), o ) ) |
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
// Paste into the Ramda REPL at http://ramdajs.com/repl/ | |
// NESW - doubly linked list, cyclical | |
const compass = [[1, 1], [[0, 1], [[1, -1], [[0, -1]]]]] | |
compass[1][1][1][1] = compass | |
compass[1][2] = compass | |
compass[1][1][2] = compass[1] | |
compass[1][1][1][2] = compass[1][1] | |
compass[2] = compass[1][1][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
/*The MIT License (MIT) | |
Copyright (c) 2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/kurtmilam/886b705fb0eb03001c77 | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN AC |
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
When you're ready to publish to bower, NPM, etc., do the following: | |
1. Figure out what the new NPM version number will be (semver major.minor.patch) | |
2. Update the version numbers to the (soon to be) new NPM version number in bower.json, component.json, etc. (but not in package.json) | |
3. Commit the repo with a message like "Updated version number in bower and component.json" | |
4. Run the NPM version command: | |
> npm version major|minor|patch|[new version number] -m "Updating NPM version" | |
//This step updates the version number in package.json. If you did steps 1-3 correctly, the version number in package, bower and component.json should be the same | |
5. Run the NPM publish command: | |
> npm publish |
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
/* Copyright (C) 2012-2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/6316124 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO |
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
/* Copyright (C) 2012-2013 Kurt Milam - http://xioup.com | Source: https://gist.github.com/6316082 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO |