Skip to content

Commit

Permalink
Rename mixins to talons (#1757)
Browse files Browse the repository at this point in the history
* Rename mixins to talons
  • Loading branch information
jimbo authored Sep 23, 2019
1 parent a1d4d6a commit 92f7814
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Peregrine Mixins
# Peregrine Talons

Peregrine mixins are hooks that contain component logic.
Peregrine "talons" are hooks that contain component-specific logic.

## Example

The following example shows how a component looks after the logic has migrated. Notice how all logic is contained within a single component hook that takes props and returns the necessary render values.
The following example shows how a component looks after its logic has been extracted into a talon. Notice how the logic is contained within a single component hook that receives props and returns the necessary render values.

### Before

Expand Down Expand Up @@ -45,7 +45,7 @@ const MyComponent = props => {

```js
import React from 'react';
import { useMyComponent } from '@magento/peregrine/lib/mixins/useMyComponent';
import { useMyComponent } from '@magento/peregrine/lib/talons/MyComponent';

const MyComponent = props => {
const { data, message } = useMyComponent(props);
Expand Down
2 changes: 1 addition & 1 deletion packages/venia-ui/lib/components/MyAccount/myAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { func, shape, string } from 'prop-types';
import { mergeClasses } from '../../classify';
import AccountLink from './accountLink';
import defaultClasses from './myAccount.css';
import { useMyAccount } from '@magento/peregrine/lib/mixins/MyAccount/useMyAccount';
import { useMyAccount } from '@magento/peregrine/lib/talons/MyAccount/useMyAccount';

const PURCHASE_HISTORY = 'Purchase History';
const SIGN_OUT = 'Sign Out';
Expand Down
2 changes: 1 addition & 1 deletion packages/venia-ui/lib/components/SignIn/signIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TextInput from '../TextInput';
import { isRequired } from '../../util/formValidators';

import defaultClasses from './signIn.css';
import { useSignIn } from '@magento/peregrine/lib/mixins/SignIn/useSignIn';
import { useSignIn } from '@magento/peregrine/lib/talons/SignIn/useSignIn';

const SignIn = props => {
const classes = mergeClasses(defaultClasses, props.classes);
Expand Down

0 comments on commit 92f7814

Please # to comment.